@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Exact IT Brand Colors (Matched with Comms Portal) */
    --brand-navy: #001A72;
    --brand-navy-dark: #00114a;
    --brand-navy-light: #1e3a8a;
    --brand-teal: #4EB199;
    --brand-teal-hover: #3e917c;
    --brand-teal-soft: rgba(78, 177, 153, 0.14);
    --brand-magenta: #902766;
    --brand-magenta-hover: #7a1f51;
    --brand-magenta-soft: rgba(144, 39, 102, 0.12);
    --brand-blue: #2563eb;
    --brand-mint: #10b981;
    --brand-orange: #d97706;
    --brand-red: #dc2626;

    /* Layout Colors */
    --bg-color: #f1f5f9;
    --bg-page: #f1f5f9;
    --bg-sidebar: linear-gradient(180deg, #001A72 0%, #000e3d 100%);
    --card-bg: #ffffff;
    --bg-card: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-surface-subtle: #f8fafc;
    --brand-navy-subtle: rgba(0, 26, 114, 0.07);
    --input-bg: #ffffff;

    /* Borders */
    --border-color: #e2e8f0;
    --border-light: #e2e8f0;
    --border-subtle: #eef2f6;
    --border-strong: #cbd5e1;
    --border-focus: rgba(78, 177, 153, 0.35);

    /* Typography Colors */
    --text-primary: #0f172a;
    --text-main: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    /* Semantic Aliases */
    --accent-color: var(--brand-teal);
    --accent-hover: var(--brand-teal-hover);
    --danger-color: var(--brand-magenta);
    --danger-hover: var(--brand-magenta-hover);
    --success-color: var(--brand-teal);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.07), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 28px -6px rgba(15, 23, 42, 0.12), 0 4px 10px -3px rgba(15, 23, 42, 0.06);
    --shadow-xl: 0 20px 40px -12px rgba(0, 26, 114, 0.22);

    /* Radii */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-pill: 9999px;

    --transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    min-height: 100vh;
    width: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--brand-navy);
    letter-spacing: -0.02em;
}
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 800; }
h3 { font-size: 1.12rem; font-weight: 700; }
h4 { font-size: 0.95rem; font-weight: 600; }

/* --- Layout Shell & Sidebar --- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.main-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.15rem;
    box-shadow: 4px 0 24px rgba(0, 17, 74, 0.15);
    z-index: 20;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.logo, .sidebar-logo {
    margin-bottom: 1.5rem;
    padding: 0 0.35rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-logo-box {
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.sidebar-logo-img {
    max-width: 185px;
    width: 100%;
    height: auto;
    display: block;
}

.sidebar-portal-badge {
    margin-top: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.24rem 0.75rem;
    border-radius: var(--radius-pill);
    background: rgba(78, 177, 153, 0.16);
    border: 1px solid rgba(78, 177, 153, 0.35);
    color: var(--brand-teal);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sidebar-portal-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-teal);
    display: inline-block;
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.42);
    padding: 0.75rem 0.9rem 0.35rem;
    margin-top: 0.35rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    text-align: left;
    padding: 0.72rem 0.95rem;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
    transition: var(--transition);
}

.nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(78, 177, 153, 0.22) 0%, rgba(78, 177, 153, 0.06) 100%);
    color: #ffffff;
    border-left: 3px solid var(--brand-teal);
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.nav-item.active svg {
    color: var(--brand-teal);
    opacity: 1;
}

.sidebar-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.user-profile-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.65rem 0.8rem;
    border-radius: var(--radius-sm);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-teal), #2d8a73);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#current-username-display {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.88rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#current-role-display {
    color: var(--brand-teal);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.15rem;
}

.sidebar-signout-btn, #logout-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: rgba(255, 255, 255, 0.92) !important;
    padding: 0.58rem !important;
    font-size: 0.84rem !important;
}

.sidebar-signout-btn:hover, #logout-btn:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
}

/* --- Main Content Shell & Sticky Topbar --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--bg-page);
}

.topbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-top: 3px solid var(--brand-teal);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    padding: 0.75rem 2.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 15;
}

.topbar-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.32rem 0.45rem 0.32rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
}

.topbar-breadcrumb .crumb-root {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-weight: 600;
}

.topbar-breadcrumb .crumb-root svg {
    color: var(--brand-teal);
}

.topbar-breadcrumb .crumb-section {
    color: var(--text-secondary);
    font-weight: 600;
}

.topbar-breadcrumb .sep {
    display: inline-flex;
    align-items: center;
    color: #94a3b8;
}

.topbar-breadcrumb .current {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, var(--brand-navy) 0%, #0d329e 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0.26rem 0.8rem;
    border-radius: var(--radius-pill);
    box-shadow: 0 2px 6px rgba(0, 26, 114, 0.2);
}

.topbar-breadcrumb .current::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-teal);
    display: inline-block;
}

.topbar-actions, .topbar-Actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.28rem 0.75rem;
    background: rgba(78, 177, 153, 0.16);
    border: 1px solid rgba(78, 177, 153, 0.4);
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #216e5b;
}

.role-badge.admin {
    background: rgba(144, 39, 102, 0.15);
    border-color: rgba(144, 39, 102, 0.4);
    color: var(--brand-magenta);
}

.page-body, .content-wrapper {
    flex: 1;
    padding: 1.75rem 2.25rem 3rem;
    max-width: 1520px;
    width: 100%;
    margin: 0 auto;
}

.page-body > header, .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #001A72 0%, #092c8a 62%, #17696b 100%);
    padding: 1.35rem 1.75rem;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 20px -4px rgba(0, 26, 114, 0.18);
    border-left: 5px solid var(--brand-teal);
}

.page-body > header h2, .page-header h2 {
    margin-bottom: 0.2rem;
    color: #ffffff;
    font-size: 1.4rem;
}

.page-body > header .help-text {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.86rem;
}

/* --- Metric Cards Strip (Comms Style) --- */
.metrics-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-top: 4px solid var(--brand-teal);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.4rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.metric-card.accent-navy { border-top-color: var(--brand-navy); }
.metric-card.accent-teal { border-top-color: var(--brand-teal); }
.metric-card.accent-magenta { border-top-color: var(--brand-magenta); }
.metric-card.accent-emerald { border-top-color: var(--brand-mint); }

.metric-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-card-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}

.metric-value {
    color: var(--brand-navy);
    font-size: 1.75rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.metric-sub {
    font-size: 0.78rem;
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-weight: 500;
}

.metric-icon-box {
    padding: 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --- Cards & Grids --- */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* --- Forms & Controls --- */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin-bottom: 0.38rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.input, input[type="text"], input[type="number"], input[type="email"], input[type="password"], input[type="date"], select, textarea {
    width: 100%;
    padding: 0.62rem 0.9rem;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.88rem;
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
}

.input:hover, select:hover, textarea:hover {
    border-color: #cbd5e1;
}

.input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-teal);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--border-focus);
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    line-height: 1.45;
}

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* --- Buttons --- */
.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 1.15rem;
    font-weight: 600;
    font-size: 0.86rem;
    font-family: inherit;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition);
    background: #ffffff;
    color: var(--brand-navy);
    box-shadow: var(--shadow-xs);
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-navy) 0%, #002596 100%);
    color: #ffffff;
    border: 1px solid transparent;
    box-shadow: 0 2px 6px rgba(0, 26, 114, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--brand-navy-dark) 0%, var(--brand-navy) 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 26, 114, 0.28);
}

.btn-teal, .btn-icon {
    background: linear-gradient(135deg, var(--brand-teal) 0%, #3d9982 100%);
    color: #ffffff;
    border: 1px solid transparent;
    box-shadow: 0 2px 6px rgba(78, 177, 153, 0.25);
}

.btn-teal:hover:not(:disabled), .btn-icon:hover:not(:disabled) {
    background: var(--brand-teal-hover);
    color: #ffffff;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover:not(:disabled) {
    background: #f1f5f9;
    color: var(--brand-navy);
    border-color: #cbd5e1;
}

.btn-danger {
    background: linear-gradient(135deg, var(--brand-magenta) 0%, #7a1f51 100%);
    color: #ffffff;
    border: 1px solid transparent;
    box-shadow: 0 2px 6px rgba(144, 39, 102, 0.25);
}

.btn-danger:hover:not(:disabled) {
    background: var(--brand-magenta-hover);
    color: #ffffff;
}

.btn-sm {
    padding: 0.38rem 0.75rem;
    font-size: 0.78rem;
}

.btn-remove {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.25rem 0.55rem;
    font-size: 1.05rem;
    line-height: 1;
    box-shadow: none;
}

.btn-remove:hover {
    background: var(--brand-magenta-soft);
    color: var(--brand-magenta);
    border-color: rgba(144, 39, 102, 0.2);
}

/* --- Lists & Data Tables --- */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1rem;
    max-height: 280px;
    overflow-y: auto;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-subtle);
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text-main);
}

.add-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

th {
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    color: var(--text-main);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background-color: #f8fafc;
}

/* --- Category & Status Pills --- */
.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.category-pill.ms {
    background: rgba(78, 177, 153, 0.15);
    color: #2b7a66;
}

.category-pill.voip {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.category-pill.consulting, .category-pill.bak {
    background: rgba(217, 119, 6, 0.14);
    color: #b45309;
}

.category-pill.sec {
    background: rgba(144, 39, 102, 0.12);
    color: var(--brand-magenta);
}

.category-pill.other {
    background: #f1f5f9;
    color: #64748b;
}

/* --- Month Filter Pills --- */
.month-filter-bar {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.month-pill {
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: none;
}

.month-pill:hover {
    color: var(--brand-navy);
    border-color: #cbd5e1;
    background: #ffffff;
    transform: none;
}

.month-pill.active {
    background: var(--brand-navy);
    color: #ffffff;
    border-color: var(--brand-navy);
}

/* --- Execution Console --- */
.console-card {
    grid-column: 1 / -1;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.console-actions {
    display: flex;
    gap: 0.65rem;
    align-items: center;
}

.console-window {
    background: #0f172a;
    border-radius: var(--radius-sm);
    padding: 1.1rem 1.25rem;
    height: 300px;
    overflow-y: auto;
    border: 1px solid #1e293b;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
    font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
}

pre {
    color: #34d399;
    font-size: 0.84rem;
    white-space: pre-wrap;
    line-height: 1.55;
}

/* --- Autocomplete --- */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
    z-index: 50;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    z-index: 1000;
    display: none;
    list-style: none !important;
    box-shadow: var(--shadow-lg);
    margin: 0.25rem 0 0 0;
    padding: 0;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-dropdown li {
    padding: 0.65rem 0.95rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    display: block;
}

.autocomplete-dropdown li:hover {
    background: var(--brand-teal);
    color: #ffffff;
}

.autocomplete-dropdown li:last-child {
    border-bottom: none;
}

/* --- Dashboard Layout & Client List --- */
.dashboard-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    position: relative;
    z-index: 5;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 1.25rem 0;
}

.client-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-light);
}

.client-list-header h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.input-small {
    padding: 0.4rem 0.65rem !important;
    font-size: 0.78rem !important;
    width: 150px !important;
}

.client-list-container {
    max-height: 520px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-right: 0.2rem;
}

.client-list-item {
    display: flex;
    align-items: center;
    padding: 0.68rem 0.85rem;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-left: 3px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.client-list-item:hover {
    border-color: #cbd5e1;
    background: var(--bg-subtle);
}

.client-list-item.active {
    background: rgba(78, 177, 153, 0.08);
    border-color: rgba(78, 177, 153, 0.4);
    border-left: 3px solid var(--brand-teal);
}

.client-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 9px;
    background: rgba(0, 26, 114, 0.08);
    color: var(--brand-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.88rem;
    margin-right: 0.85rem;
}

.client-list-item.active .client-avatar {
    background: linear-gradient(135deg, var(--brand-teal), #2d8a73);
    color: #ffffff;
}

.client-info {
    flex: 1;
    overflow: hidden;
}

.client-info h4 {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-meta {
    font-size: 0.74rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.client-list-container::-webkit-scrollbar {
    width: 6px;
}
.client-list-container::-webkit-scrollbar-track {
    background: transparent;
}
.client-list-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.client-list-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* --- Reminder Milestone Cards --- */
.reminder-milestone-card {
    background: var(--bg-subtle);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--brand-teal);
}

/* --- Login Overlay (Matched with Comms Portal) --- */
.login-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: radial-gradient(circle at 15% 20%, rgba(78, 177, 153, 0.18), transparent 40%),
                radial-gradient(circle at 85% 80%, rgba(144, 39, 102, 0.15), transparent 40%),
                linear-gradient(135deg, #00114a 0%, #001A72 55%, #0a256e 100%);
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.98);
    padding: 2.75rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(16px); }
    100% { opacity: 1; transform: translateY(0); }
}

.text-center {
    text-align: center;
}

.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    width: 100%;
}

.login-logo-img {
    max-width: 240px;
    width: 100%;
    height: auto;
    display: block;
}

.login-header h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--brand-navy);
    margin-bottom: 0.3rem;
}

.login-portal-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.32rem 0.9rem;
    margin-bottom: 0.9rem;
    border-radius: 999px;
    background: rgba(0, 26, 114, 0.07);
    border: 1px solid rgba(0, 26, 114, 0.12);
    color: var(--brand-navy);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.login-error {
    padding: 0.75rem 1rem;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.25);
    border-radius: 8px;
    color: #b91c1c;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 1rem;
    text-align: center;
}

.admin-only {
    display: none;
}

.viewer-only {
    display: none;
}

@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .grid {
        grid-template-columns: 1fr;
    }
}
