@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Compact Slate & Teal Color Palette */
    --bg-dark: #f3f7f6;
    --bg-card: #ffffff;
    --bg-card-hover: #f7faf9;
    --bg-surface: #f7faf9;
    --border-color: #dce7e4;
    --border-color-hover: rgba(15, 118, 110, 0.3);
    
    --primary: #0f766e;
    --primary-hover: #115e59;
    --primary-light: #f0fdfa;
    
    --success: #16a34a;
    --success-light: #f0fdf4;
    
    --warning: #d97706;
    --warning-light: #fffbeb;
    
    --danger: #dc2626;
    --danger-light: #fef2f2;
    
    --info: #0891b2;
    --info-light: #ecfeff;
    
    --text-main: #17211f;
    --text-muted: #52635f;
    --text-dim: #82938f;
    
    --sidebar-width: 232px;
    --header-height: 58px;
    --radius-sm: 6px;
    --radius-md: 9px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    
    --shadow-card: 0 2px 10px rgba(20, 58, 53, 0.06), 0 1px 2px rgba(15, 23, 42, 0.03);
    --shadow-glow: 0 0 16px rgba(15, 118, 110, 0.18);
}

html {
    font-size: 15px;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - Compact Slate & Teal */
.app-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #163c38 0%, #0f766e 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 3px 0 18px rgba(20, 58, 53, 0.14);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 800;
    font-size: 1.05rem;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: #ffffff;
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 12px rgba(255, 255, 255, 0.4); }
    100% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.8); }
}

.sidebar-menu {
    list-style: none;
    padding: 0.9rem 0.65rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow-y: auto;
}

.sidebar-item {
    border-radius: var(--radius-sm);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.58rem 0.75rem;
    color: #ccfbf1;
    font-weight: 500;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.12);
    transform: translateX(2px);
}

.sidebar-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.2);
    border-left: 4px solid #ffffff;
    font-weight: 600;
}

.sidebar-link i {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.48rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.8rem;
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.app-header {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.page-title-group h1 {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Header Notification Menu */
.notification-menu {
    position: relative;
}

.notification-toggle {
    position: relative;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #f1f5f4;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.notification-toggle:hover,
.notification-menu.open .notification-toggle {
    background: var(--primary-light);
    border-color: #99f6e4;
    color: var(--primary);
}

.notification-toggle:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.18);
    outline-offset: 2px;
}

.notification-badge {
    position: absolute;
    top: -7px;
    right: -8px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    border-radius: var(--radius-full);
    background: var(--danger);
    color: #ffffff;
    font-size: 0.625rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(350px, calc(100vw - 2rem));
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
    z-index: 200;
}

.notification-dropdown[hidden] {
    display: none;
}

.notification-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.notification-dropdown-header strong,
.notification-dropdown-header span {
    display: block;
}

.notification-dropdown-header strong {
    color: var(--text-main);
    font-size: 0.925rem;
}

.notification-dropdown-header div > span {
    margin-top: 0.1rem;
    color: var(--text-muted);
    font-size: 0.725rem;
}

.notification-dropdown-header .notification-total {
    min-width: 28px;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    background: var(--danger-light);
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 800;
    text-align: center;
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid #f1f5f9;
    color: inherit;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
}

.notification-item-icon.is-expired {
    background: var(--danger-light);
    color: var(--danger);
}

.notification-item-icon.is-upcoming {
    background: var(--warning-light);
    color: #d97706;
}

.notification-item-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.notification-item-content strong,
.notification-item-content span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-item-content strong {
    color: var(--text-main);
    font-size: 0.825rem;
}

.notification-item-content span {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.notification-item-content small {
    margin-top: 0.15rem;
    color: var(--danger);
    font-size: 0.7rem;
    font-weight: 600;
}

.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 0.8rem;
    color: var(--text-muted);
    font-size: 0.825rem;
}

.notification-empty i {
    color: var(--success);
    font-size: 1.5rem;
}

.notification-dropdown-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    color: var(--primary);
    font-size: 0.775rem;
    font-weight: 700;
}

.notification-dropdown-footer:hover {
    background: var(--primary-light);
}

/* Content Container */
.content-body {
    padding: 1.25rem;
    flex: 1;
}

/* Cards & Widgets */
.glass-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 1rem;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
    border-color: rgba(15, 118, 110, 0.22);
    box-shadow: 0 6px 20px -4px rgba(15, 118, 110, 0.11);
}

/* Primary Category & Service Item Differentiation Styles */
.category-card {
    border-left: 5px solid var(--primary);
    background: #ffffff;
}

.primary-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid #99f6e4;
}

.service-item-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    background: #f1f5f4;
    color: #334155;
    border: 1px solid #d2dedb;
}

.nested-service-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-top: 0.75rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, rgba(15,118,110,0.07) 0%, rgba(15,118,110,0) 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.stat-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }

.stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.stat-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.35rem;
}

/* Compact Dashboard Charts */
.dashboard-charts-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) minmax(410px, 1.25fr);
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.chart-card {
    min-width: 0;
}

.chart-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.chart-card-header h3 {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 700;
}

.chart-card-header p {
    margin-top: 0.1rem;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.chart-card-header > i {
    color: var(--primary);
    font-size: 0.95rem;
}

.renewal-health-chart {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 1rem;
    min-height: 130px;
}

.donut-chart {
    --expired-end: 0%;
    --due-end: 0%;
    --upcoming-end: 0%;
    position: relative;
    flex: 0 0 122px;
    width: 122px;
    height: 122px;
    border-radius: 50%;
    background: conic-gradient(
        var(--danger) 0 var(--expired-end),
        var(--warning) var(--expired-end) var(--due-end),
        var(--info) var(--due-end) var(--upcoming-end),
        var(--primary) var(--upcoming-end) 100%
    );
}

.donut-chart.is-empty {
    background: var(--border-color);
}

.donut-chart::before {
    content: '';
    position: absolute;
    inset: 18px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-card);
}

.donut-center {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.donut-center strong {
    color: var(--text-main);
    font-size: 1.45rem;
    line-height: 1;
}

.donut-center span {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chart-legend {
    min-width: 155px;
    display: flex;
    flex-direction: column;
    gap: 0.48rem;
}

.chart-legend > div {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.chart-legend strong {
    color: var(--text-main);
    font-size: 0.74rem;
}

.chart-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.chart-dot.expired { background: var(--danger); }
.chart-dot.due { background: var(--warning); }
.chart-dot.upcoming { background: var(--info); }
.chart-dot.healthy { background: var(--primary); }

.monthly-bar-chart {
    height: 142px;
    display: grid;
    grid-template-columns: repeat(6, minmax(28px, 1fr));
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.2rem 0.25rem 0;
}

.month-bar-column {
    min-width: 0;
    display: grid;
    grid-template-rows: 18px 1fr 18px;
    align-items: end;
    text-align: center;
}

.month-bar-value {
    align-self: center;
    color: var(--text-main);
    font-size: 0.68rem;
    font-weight: 700;
}

.month-bar-track {
    position: relative;
    width: min(30px, 70%);
    height: 100%;
    justify-self: center;
    overflow: hidden;
    border-radius: 4px 4px 2px 2px;
    background: #eef3f2;
}

.month-bar-fill {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 3px;
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(180deg, #14b8a6 0%, var(--primary) 100%);
}

.month-bar-fill.empty {
    background: var(--border-color);
}

.month-bar-label {
    align-self: end;
    padding-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.67rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Data Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.82rem;
}

.custom-table th {
    background-color: var(--bg-surface);
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
}

.custom-table td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

.custom-table tbody tr {
    transition: background-color 0.15s ease;
}

.custom-table tbody tr:hover {
    background-color: #f1f6f4;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-info { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }

.badge-warning-glowing {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Buttons & Inputs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.48rem 0.85rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 3px 9px rgba(15, 118, 110, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(15, 118, 110, 0.28);
}

.btn-secondary {
    background-color: #f1f5f4;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #e3ebe8;
}

.btn-success {
    background-color: var(--success);
    color: #fff;
}
.btn-success:hover { background-color: #059669; }

.btn-danger {
    background-color: var(--danger);
    color: #fff;
}
.btn-danger:hover { background-color: #dc2626; }

.btn-sm {
    padding: 0.28rem 0.6rem;
    font-size: 0.74rem;
    border-radius: var(--radius-sm);
}

.form-group {
    margin-bottom: 0.9rem;
}

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.form-control {
    width: 100%;
    padding: 0.52rem 0.7rem;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.82rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

textarea.form-control {
    min-height: 68px;
    resize: vertical;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.active .modal-card {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-surface);
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover { color: var(--text-main); }

.modal-body {
    padding: 1rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-surface);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    color: var(--text-main);
    font-size: 0.8rem;
    animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--primary); }

@keyframes toastIn {
    from { transform: translateY(100%) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Filter Toolbar */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.search-box {
    position: relative;
    min-width: 220px;
}

.search-box input {
    padding-left: 2.3rem;
}

.search-box i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Full-page Subscription Form */
.subscription-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.subscription-page-header h2 {
    margin-top: 0.25rem;
    color: var(--text-main);
    font-size: 1.3rem;
}

.subscription-page-header p {
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.subscription-back-link {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.subscription-form-card {
    padding: 0;
    overflow: visible;
}

.subscription-form-section {
    padding: 1.15rem 1.25rem 0.35rem;
    border-bottom: 1px solid var(--border-color);
}

.subscription-section-heading {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.9rem;
}

.subscription-section-heading > span {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
}

.subscription-section-heading h3 {
    color: var(--text-main);
    font-size: 0.92rem;
}

.subscription-section-heading p {
    margin-top: 0.05rem;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.form-label-row a {
    margin-bottom: 0.3rem;
    font-size: 0.68rem;
    font-weight: 600;
}

.subscription-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.form-help {
    margin-top: 0.25rem;
    color: var(--text-dim);
    font-size: 0.7rem;
}

/* Multiple Supporting Documents */
.multi-document-picker {
    padding: 0.55rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
}

.multi-document-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.multi-document-toolbar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.multi-document-count {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.multi-document-list {
    display: grid;
    gap: 0.35rem;
}

.multi-document-list:not(:empty) {
    margin-top: 0.5rem;
}

.multi-document-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.42rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: #ffffff;
}

.multi-document-details {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.multi-document-details > i {
    color: var(--primary);
    font-size: 0.86rem;
}

.multi-document-details span {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.multi-document-details strong {
    overflow: hidden;
    color: var(--text-main);
    font-size: 0.72rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-document-details small {
    color: var(--text-dim);
    font-size: 0.64rem;
}

.multi-document-remove {
    width: 25px;
    height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 25px;
    border: 0;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.08);
    color: var(--danger);
    cursor: pointer;
}

.multi-document-remove:hover,
.multi-document-remove:focus {
    outline: none;
    background: rgba(220, 38, 38, 0.15);
}

/* Searchable Select Dropdown */
.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select-native {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.searchable-select-toggle {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.52rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
}

.searchable-select-toggle span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searchable-select-toggle i {
    flex: 0 0 auto;
    color: var(--text-dim);
    font-size: 0.68rem;
    transition: transform 0.2s ease;
}

.searchable-select.open .searchable-select-toggle {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.searchable-select.invalid .searchable-select-toggle {
    border-color: var(--danger);
}

.searchable-select.open .searchable-select-toggle > i {
    transform: rotate(180deg);
}

.searchable-select-toggle:disabled {
    background: var(--bg-surface);
    color: var(--text-dim);
    cursor: not-allowed;
}

.searchable-select-panel {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    z-index: 350;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(20, 58, 53, 0.16);
}

.searchable-select-panel[hidden] {
    display: none;
}

.searchable-select-search {
    position: relative;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.searchable-select-search i {
    position: absolute;
    top: 50%;
    left: 1.05rem;
    color: var(--text-dim);
    font-size: 0.72rem;
    transform: translateY(-50%);
}

.searchable-select-search input {
    width: 100%;
    padding: 0.48rem 0.65rem 0.48rem 1.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.78rem;
    outline: none;
}

.searchable-select-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.searchable-select-options {
    max-height: 210px;
    overflow-y: auto;
    padding: 0.25rem;
}

.searchable-select-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.48rem 0.55rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.78rem;
    text-align: left;
    cursor: pointer;
}

.searchable-select-option:hover,
.searchable-select-option:focus {
    outline: none;
    background: var(--primary-light);
    color: var(--primary-hover);
}

.searchable-select-option[aria-selected="true"] {
    color: var(--primary);
    font-weight: 700;
}

.searchable-select-option i {
    font-size: 0.68rem;
}

.searchable-select-empty {
    padding: 0.8rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
}

.subscription-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.9rem 1.25rem;
    background: var(--bg-surface);
}

/* Compact Teal Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #ccfbf1 0%, #f0fdfa 42%, #eef3f2 100%);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid #cce7e1;
    border-radius: var(--radius-lg);
    padding: 2rem 1.6rem;
    box-shadow: 0 18px 36px rgba(15, 118, 110, 0.12);
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Utility grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .app-header { padding: 0 1rem; }
    .header-actions { gap: 0.5rem; }
    .notification-dropdown {
        position: fixed;
        top: calc(var(--header-height) + 8px);
        right: 1rem;
        left: 1rem;
        width: auto;
    }
    .dashboard-charts-grid { grid-template-columns: 1fr; }
    .monthly-bar-chart { gap: 0.45rem; }
    .subscription-grid-3 { grid-template-columns: 1fr; }
    .subscription-form-section { padding: 1rem 1rem 0.25rem; }
    .subscription-form-actions { padding: 0.8rem 1rem; }
}

@media (max-width: 360px) {
    .renewal-health-chart {
        flex-direction: column;
        align-items: stretch;
    }
    .donut-chart { align-self: center; }
    .chart-legend { min-width: 0; }
}
