/* GACS Dashboard Custom Styles */

:root {
    /* Modern Professional Color Palette */
    --primary-color: #d11f2f;        /* Harmonika red */
    --primary-dark: #9f1623;         /* Darker red */
    --primary-light: #e24b59;        /* Lighter red */

    --secondary-color: #64748B;      /* Slate Gray */
    --success-color: #10B981;        /* Emerald Green */
    --danger-color: #EF4444;         /* Red */
    --warning-color: #F59E0B;        /* Amber */
    --info-color: #3B82F6;           /* Blue */

    --dark-color: #1E293B;           /* Dark Slate */
    --darker-color: #0F172A;         /* Darker Slate */
    --light-color: #F8FAFC;          /* Very Light Gray */
    --gray-100: #F1F5F9;             /* Light Gray */
    --gray-200: #E2E8F0;             /* Medium Light Gray */
    --gray-300: #CBD5E1;             /* Medium Gray */

    --sidebar-bg: #111827;           /* Dark neutral sidebar */
    --sidebar-hover: #1f2937;        /* Sidebar Hover */
    --topbar-bg: #FFFFFF;            /* Clean White Topbar */

    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-100);
    min-height: 100vh;
    height: 100%;
    margin: 0;
    padding: 0;
    zoom: 80%;
}

.brand-logo {
    width: 165px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 0.75rem;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.18));
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 0.45rem;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100%;
    min-height: 100vh;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.08);
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width) !important;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.sidebar-toggle {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 1.2rem;
    z-index: 1001;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar.collapsed .sidebar-toggle {
    left: 15px;
}

.sidebar.collapsed .sidebar-header {
    padding: 1rem 0.5rem;
}

.sidebar.collapsed .brand-logo {
    width: 42px;
    margin-bottom: 0;
}

.sidebar-header h3 {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
    word-wrap: break-word;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-header h3 {
    opacity: 0;
    height: 0;
    font-size: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s;
    background: transparent;
    position: relative;
}

.sidebar.collapsed .sidebar-menu a {
    padding: 1rem 0;
    justify-content: center;
}

.sidebar-menu a:hover {
    background: var(--sidebar-hover);
    color: white;
}

.sidebar-menu a.active {
    background: var(--sidebar-hover);
    color: white;
    border-left: 4px solid var(--primary-color);
    padding-left: calc(1.25rem - 4px);
}

.sidebar.collapsed .sidebar-menu a:hover,
.sidebar.collapsed .sidebar-menu a.active {
    padding-left: 0;
    border-left: none;
    border-bottom: 3px solid var(--primary-color);
}

.sidebar-menu i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-menu i {
    margin-right: 0;
    font-size: 1.3rem;
}

.sidebar-menu span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-menu span {
    opacity: 0;
    width: 0;
    display: none;
}

/* Tooltip for collapsed sidebar */
.sidebar.collapsed .sidebar-menu a {
    position: relative;
}

.sidebar.collapsed .sidebar-menu a::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--darker-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-left: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1002;
}

.sidebar.collapsed .sidebar-menu a:hover::after {
    opacity: 1;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--light-color);
    transition: margin-left 0.3s ease;
}

.main-content.collapsed {
    margin-left: var(--sidebar-collapsed-width) !important;
}

.topbar {
    background: var(--topbar-bg);
    padding: 1rem 1.5rem 0.95rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(8px);
}

.topbar h4 {
    margin: 0;
    color: var(--dark-color);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.topbar-brand {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.topbar-brand small {
    color: var(--secondary-color);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(203, 213, 225, 0.85);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    color: var(--dark-color);
    font-weight: 600;
}

.content-wrapper {
    padding: 1.5rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.95);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    color: var(--dark-color);
    padding: 1rem 1.25rem;
    font-weight: 700;
    border-bottom: 1px solid var(--gray-200);
    letter-spacing: -0.01em;
}

.card-body {
    padding: 1.25rem;
}

.page-section-heading {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--dark-color);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.page-section-heading i {
    color: var(--primary-color);
}

.device-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.device-detail-card .card-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
}

#deviceTabs {
    gap: 0.45rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    padding-bottom: 0.35rem;
}

#deviceTabs .nav-link {
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 12px;
    color: var(--dark-color);
    font-weight: 600;
    padding: 0.72rem 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

#deviceTabs .nav-link.active {
    background: linear-gradient(135deg, rgba(209, 31, 47, 0.1) 0%, rgba(159, 22, 35, 0.08) 100%);
    border-color: rgba(209, 31, 47, 0.22);
    color: var(--primary-dark);
}

#deviceTabContent {
    padding-top: 0.35rem;
}

#overview-content h6,
#topology-content h6,
#wan-content h6,
#dhcp-content h6,
#devices-content h6 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.85rem;
    letter-spacing: -0.01em;
}

#overview-content h6 i,
#topology-content h6 i,
#wan-content h6 i,
#dhcp-content h6 i,
#devices-content h6 i {
    color: var(--primary-color);
}

.table.table-sm.table-bordered,
#connected-devices-table {
    border-color: rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    overflow: hidden;
    background: white;
}

.table.table-sm.table-bordered th,
.table.table-sm.table-bordered td,
#connected-devices-table th,
#connected-devices-table td {
    padding: 0.75rem 0.9rem;
    vertical-align: middle;
}

.table.table-sm.table-bordered th,
#connected-devices-table th {
    width: auto;
    color: var(--dark-color);
    font-weight: 700;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

#overview-content .btn-link,
#wan-content .btn-link,
#dhcp-content .btn-link,
#devices-content .btn-link {
    color: var(--primary-color);
    text-decoration: none;
    box-shadow: none;
}

#overview-content code,
#wan-content code,
#dhcp-content code,
#devices-content code {
    padding: 0.18rem 0.45rem;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--primary-dark);
    border: 1px solid rgba(226, 232, 240, 0.95);
}

#topology-content .alert,
#wan-content .alert,
#dhcp-content .alert,
#devices-content .alert,
#overview-content .alert {
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.modal-dialog.modal-lg {
    max-width: 860px;
}

.modal-content form .form-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.45rem;
}

.modal-content form .form-label i {
    color: var(--primary-color);
}

.modal-content .form-control,
.modal-content .form-select {
    min-height: 46px;
    border-radius: 12px;
}

.modal-content .input-group .btn {
    border-radius: 12px;
}

.modal-content .form-text {
    color: #64748B;
}

.modal-content .alert {
    border-radius: 14px;
}

#map {
    height: 600px;
    border-radius: 18px;
    overflow: hidden;
}

.leaflet-control-zoom a {
    border-radius: 10px !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

/* Stats Cards */
.stats-grid {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: nowrap;
}

.stat-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    border-radius: 16px;
    padding: 1.15rem 1.2rem;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.07);
    border: 1px solid rgba(226, 232, 240, 0.95);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    flex: 1 1 0;
    min-width: 0;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.1);
    border-color: var(--gray-300);
}

.stat-card.primary {
    border-top: 3px solid var(--primary-color);
}

.stat-card.success {
    border-top: 3px solid var(--success-color);
}

.stat-card.danger {
    border-top: 3px solid var(--danger-color);
}

.stat-card.warning {
    border-top: 3px solid var(--warning-color);
}

.stat-icon {
    font-size: 1.9rem;
    opacity: 0.22;
    flex-shrink: 0;
    margin-left: 0.75rem;
}

.stat-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.stat-info h3 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-info p {
    margin: 0.3rem 0 0 0;
    color: var(--secondary-color);
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.9);
}

#device-stats-badges,
#active-filter-badges,
#site-summary-badges,
#unmapped-summary-badges {
    row-gap: 0.5rem;
}

#device-stats-badges .badge,
#active-filter-badges .badge,
#site-summary-badges .badge,
#unmapped-summary-badges .badge {
    border-radius: 999px;
}

#devices-table {
    background: white;
}

#devices-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

#devices-table tbody tr {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

#devices-table tbody tr:hover {
    background: #f8fafc;
}

#pagination-container .page-link {
    border-radius: 10px;
    margin: 0 0.15rem;
    border-color: rgba(203, 213, 225, 0.95);
    color: var(--dark-color);
}

#pagination-container .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-color: transparent;
}

#map-container-fullscreen .alert-info {
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

#map-container-fullscreen .card-body > .row.g-2.mb-3 {
    padding: 0.2rem 0.1rem 0.35rem;
}

#map-container-fullscreen .btn-group .btn,
#map-container-fullscreen .btn {
    border-radius: 10px;
}

#map-filter-keyword,
#map-filter-type,
#map-filter-status,
#map-filter-site,
#map-filter-router {
    min-height: 42px;
    border-radius: 12px;
}

#map-card {
    border-radius: 18px;
    overflow: hidden;
}

#configTabs {
    gap: 0.45rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    padding-bottom: 0.35rem;
}

#configTabs .nav-link {
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 12px;
    color: var(--dark-color);
    font-weight: 600;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

#configTabs .nav-link.active {
    background: linear-gradient(135deg, rgba(209, 31, 47, 0.1) 0%, rgba(159, 22, 35, 0.08) 100%);
    border-color: rgba(209, 31, 47, 0.22);
    color: var(--primary-dark);
}

#configTabsContent .card {
    margin-top: 0.25rem;
}

#configTabsContent .table-sm th,
#configTabsContent .table-sm td {
    padding: 0.72rem 0.85rem;
}

#serverListModal .modal-dialog,
#oltListModal .modal-dialog,
#odcListModal .modal-dialog,
#odpListModal .modal-dialog,
#onuListModal .modal-dialog {
    max-width: 860px;
}

#serverListModal .list-group-item,
#oltListModal .list-group-item,
#odcListModal .list-group-item,
#odpListModal .list-group-item,
#onuListModal .list-group-item {
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 12px;
    margin-bottom: 0.55rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#serverListModal .list-group-item:hover,
#oltListModal .list-group-item:hover,
#odcListModal .list-group-item:hover,
#odpListModal .list-group-item:hover,
#onuListModal .list-group-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.07);
    border-color: rgba(209, 31, 47, 0.18);
}

#serverListModal .modal-body,
#oltListModal .modal-body,
#odcListModal .modal-body,
#odpListModal .modal-body,
#onuListModal .modal-body,
#addItemModal .modal-body,
#editItemModal .modal-body,
#serverLinksModal .modal-body {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

table thead {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

table th {
    padding: 0.95rem 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--dark-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    color: #475569;
    vertical-align: middle;
}

table tbody tr:hover {
    background: #f8fafc;
}

/* Badges */
.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.online {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.22);
}

.badge.offline {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.22);
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-group-text {
    border: 1px solid rgba(203, 213, 225, 0.95);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #64748B;
}

.form-select,
.form-select-sm {
    border-color: rgba(203, 213, 225, 0.95);
    border-radius: 10px;
    background-color: #fff;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.02);
}

.form-select:focus,
.form-select-sm:focus {
    border-color: rgba(209, 31, 47, 0.48);
    box-shadow: 0 0 0 4px rgba(209, 31, 47, 0.08);
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1.5rem 1.25rem;
    background:
        radial-gradient(circle at top left, rgba(209, 31, 47, 0.16), transparent 28%),
        radial-gradient(circle at bottom right, rgba(17, 24, 39, 0.18), transparent 32%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.login-card {
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
    padding: 2.25rem 2rem;
    width: 100%;
    max-width: 430px;
    overflow: hidden;
    animation: slideIn 0.5s ease;
    border: 1px solid rgba(226, 232, 240, 0.95);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.login-brand-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.38rem 0.75rem;
    margin: 0 auto 1rem;
    border-radius: 999px;
    background: rgba(209, 31, 47, 0.08);
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-brand-logo-wrap {
    width: 100%;
    max-width: 250px;
    min-height: 72px;
    max-height: 92px;
    margin: 0 auto 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-brand-logo {
    width: auto;
    max-width: 100%;
    max-height: 92px;
    height: auto;
    object-fit: contain;
    display: block;
}

.login-header h2 {
    color: var(--dark-color);
    margin-bottom: 0.4rem;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.login-header p {
    color: var(--secondary-color);
    margin-bottom: 0.2rem;
    font-size: 0.84rem;
    line-height: 1.4;
    word-break: break-word;
}

.login-brand-caption {
    color: #94A3B8;
    font-size: 0.82rem;
    line-height: 1.45;
    max-width: 290px;
    margin: 0.35rem auto 0;
}

.login-form {
    margin-top: 0.1rem;
}

.login-form-group {
    margin-bottom: 1.1rem;
}

.login-form-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
    color: var(--dark-color);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.login-form-label i {
    color: var(--primary-color);
    font-size: 0.95rem;
}

.login-input-wrap {
    position: relative;
}

.login-input-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 1rem;
    line-height: 1;
    pointer-events: none;
    transition: color 0.2s ease;
}

.login-form-control {
    min-height: 48px;
    padding: 0.8rem 0.95rem;
    border: 1px solid #d7dee8;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.02);
    font-size: 0.95rem;
}

.login-form-control::placeholder {
    color: #9AA6B2;
}

.login-input-wrap:focus-within .login-input-icon {
    color: var(--primary-color);
}

.login-form-control:focus {
    border-color: rgba(209, 31, 47, 0.48);
    box-shadow:
        0 0 0 4px rgba(209, 31, 47, 0.09),
        0 12px 24px rgba(15, 23, 42, 0.06);
    background: #fff;
}

.login-submit-btn {
    min-height: 48px;
    margin-top: 0.3rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 10px 24px rgba(209, 31, 47, 0.2);
    letter-spacing: 0.01em;
    font-size: 0.95rem;
    font-weight: 700;
}

.login-submit-btn:hover,
.login-submit-btn:focus {
    background: linear-gradient(135deg, #c01b2a 0%, #8d1320 100%);
    box-shadow: 0 14px 28px rgba(209, 31, 47, 0.24);
}

.login-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(209, 31, 47, 0.18);
}

/* Footer */
.footer {
    background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(248,250,252,0.92) 100%);
    padding: 1.1rem 1.5rem;
    text-align: center;
    color: var(--secondary-color);
    margin-top: 2rem;
    border-top: 1px solid rgba(226, 232, 240, 0.95);
    font-size: 0.84rem;
    line-height: 1.5;
}

.login-footer {
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.72);
    color: rgba(30, 41, 59, 0.82);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    z-index: 10;
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.06);
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}

/* Map Styles */
#map {
    height: 600px;
    border-radius: 10px;
    overflow: hidden;
}

/* Alert Styles */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
    font-size: 0.9375rem;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border-color: #10B981;
}

.alert-danger {
    background: rgba(254, 226, 226, 0.92);
    color: #991B1B;
    border-color: #EF4444;
}

.alert-warning {
    background: rgba(254, 243, 199, 0.95);
    color: #92400E;
    border-color: #F59E0B;
}

.alert-info {
    background: rgba(219, 234, 254, 0.92);
    color: #1D4ED8;
    border-color: #60A5FA;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Inline spin animation for icons */
.spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* Modal Styles */
.modal-content {
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
    border-radius: 12px 12px 0 0;
}

.modal-header .modal-title {
    color: var(--dark-color);
    font-weight: 600;
    font-size: 1.125rem;
}

.modal-header .modal-title i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    background: var(--gray-100);
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    border-radius: 0 0 12px 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        flex-wrap: wrap;
    }

    .stat-card {
        flex: 1 1 calc(50% - 0.25rem);
    }

    .login-container {
        padding: 1.25rem 1rem;
        align-items: center;
    }

    .login-card {
        max-width: 100%;
        padding: 1.85rem 1.2rem;
        border-radius: 14px;
    }

    .login-brand-kicker {
        margin-bottom: 0.85rem;
        font-size: 0.68rem;
    }

    .login-brand-logo-wrap {
        max-width: 205px;
        min-height: 60px;
        max-height: 76px;
        margin-bottom: 0.85rem;
    }

    .login-brand-logo {
        max-height: 76px;
    }

    .login-form-control {
        min-height: 46px;
        padding: 0.78rem 0.9rem;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .topbar {
        padding: 0.9rem 1rem;
        align-items: flex-start;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .user-info {
        width: 100%;
        justify-content: center;
    }

    .card-header {
        padding: 0.9rem 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    #deviceTabs,
    #configTabs {
        flex-wrap: wrap;
    }

    #deviceTabs .nav-link,
    #configTabs .nav-link {
        width: 100%;
    }

    .device-detail-actions {
        gap: 0.5rem;
    }

    .device-detail-actions .btn {
        width: 100%;
    }

    #serverListModal .modal-dialog,
    #oltListModal .modal-dialog,
    #odcListModal .modal-dialog,
    #odpListModal .modal-dialog,
    #onuListModal .modal-dialog,
    .modal-dialog.modal-lg {
        max-width: calc(100% - 1rem);
        margin: 0.75rem auto;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        flex-wrap: wrap;
    }

    .stat-card {
        flex: 1 1 100%;
    }

    .login-container {
        padding: 1rem 0.85rem;
    }

    .login-card {
        padding: 1.5rem 0.95rem;
    }

    .login-brand-logo-wrap {
        max-width: 176px;
        min-height: 52px;
        max-height: 64px;
    }

    .login-brand-logo {
        max-height: 64px;
    }

    .login-submit-btn {
        min-height: 48px;
    }

    .login-footer {
        padding: 1rem 0.75rem;
        font-size: 0.78rem;
    }

    .stats-grid {
        gap: 0.6rem;
    }

    .stat-card {
        padding: 1rem;
        border-radius: 14px;
    }

    .stat-info h3 {
        font-size: 1.35rem;
    }

    .page-section-heading {
        font-size: 0.95rem;
    }

    #map-filter-keyword,
    #map-filter-type,
    #map-filter-status,
    #map-filter-site,
    #map-filter-router {
        min-height: 40px;
    }
}
