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

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   HEADER - #0f172a Background
   ============================================ */
.top-header {
    height: 64px;
    background: #0f172a;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px;
}

.hamburger {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 8px;
    border-radius: 8px;
    display: block;
    flex-shrink: 0;
}
.hamburger:hover {
    background: rgba(255,255,255,0.1);
}
.hamburger span {
    position: absolute;
    left: 50%;
    width: 20px;
    height: 2.5px;
    background: #ffffff;
    border-radius: 4px;
    transform: translateX(-50%);
    transition: all 0.3s ease;
}
.hamburger span:nth-child(1) { top: 13px; }
.hamburger span:nth-child(2) { top: 19px; }
.hamburger span:nth-child(3) { top: 25px; }
.hamburger.active span:nth-child(1) {
    top: 19px;
    transform: translateX(-50%) rotate(45deg);
}
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) {
    top: 19px;
    transform: translateX(-50%) rotate(-45deg);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    font-weight: 700;
    font-size: 18px;
    color: #ffffff;
    flex-shrink: 0;
}
.brand-icon {
    font-size: 28px;
    color: #ffffff;
}
.brand-name {
    color: #ffffff;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #0f172a;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.3s ease;
    transform: translateX(-100%);
    overflow: hidden;
}
.sidebar.open {
    transform: translateX(0);
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 18px;
    color: #ffffff;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    min-height: 76px;
}
.sidebar-brand .brand-icon {
    font-size: 28px;
    color: #2563eb;
}

.sidebar-nav {
    flex: 1 1 auto;
    padding: 12px 12px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    min-height: 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
    flex-shrink: 0;
}
.nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: #ffffff;
}
.nav-link.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.nav-link.active .nav-icon {
    color: #ffffff;
}
.nav-icon {
    font-size: 22px;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    width: 100%;
    background: transparent;
    border: none;
    font-family: 'Inter', sans-serif;
    flex-shrink: 0;
    margin-top: 4px;
}
.logout-btn:hover {
    background: #ef4444;
    color: #ffffff;
}
.logout-btn:hover .nav-icon {
    color: #ffffff;
}

/* ============================================
   SIDEBAR OVERLAY
   ============================================ */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}
.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: 0;
    padding: 24px 32px;
    min-height: calc(100vh - 64px);
    background: #f1f5f9;
    transition: margin-left 0.3s ease;
}

.page-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
}

/* ============================================
   TOOLBAR
   ============================================ */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
}

.search-wrapper {
    flex: 1;
    min-width: 240px;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 16px;
}
.search-wrapper:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}
.search-icon {
    color: #94a3b8;
    font-size: 20px;
}
.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 12px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: transparent;
    color: #0f172a;
}

.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}
.filter-btn:hover {
    background: #f1f5f9;
}
.filter-btn.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* ============================================
   NOTICE
   ============================================ */
.notice {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: none;
}
.notice.success {
    background: #d1fae5;
    color: #065f46;
    display: block;
}
.notice.error {
    background: #fee2e2;
    color: #991b1b;
    display: block;
}

/* ============================================
   TABLE
   ============================================ */
.table-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
    padding: 0 4px;
}

.policy-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.policy-table thead {
    background: #f8fafc;
}
.policy-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
}
.policy-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}
.policy-table tbody tr:hover {
    background: #f8fafc;
}

/* ============================================
   STATUS BADGE
   ============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.status-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}
.status-badge.active .dot {
    background: #10b981;
}
.status-badge.cancelled {
    background: #fee2e2;
    color: #991b1b;
}
.status-badge.cancelled .dot {
    background: #ef4444;
}
.status-badge.expired {
    background: #fef3c7;
    color: #92400e;
}
.status-badge.expired .dot {
    background: #f59e0b;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */
.action-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 18px;
}
.action-btn:hover {
    background: #f1f5f9;
    color: #2563eb;
}
.action-btn.view-btn:hover {
    color: #2563eb;
}

/* ============================================
   PAGINATION
   ============================================ */
.table-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}
.page-btn:hover:not(:disabled) {
    background: #f8fafc;
}
.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.page-btn .material-symbols-rounded {
    font-size: 18px;
}

.page-numbers {
    display: flex;
    gap: 4px;
}
.page-number {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    min-width: 36px;
    text-align: center;
}
.page-number:hover {
    background: #f8fafc;
}
.page-number.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: #ffffff;
    border-radius: 16px;
    max-width: 560px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    transform: scale(0.95);
    transition: all 0.3s;
}
.modal-overlay.show .modal-box {
    transform: scale(1);
}

.logout-box {
    max-width: 400px;
    text-align: center;
    padding: 32px 24px 24px;
}
.logout-icon-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fee2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.logout-icon {
    font-size: 40px;
    color: #ef4444;
}
.logout-box h3 {
    font-size: 22px;
    color: #0f172a;
    margin-bottom: 8px;
}
.logout-box p {
    color: #64748b;
    margin-bottom: 24px;
}
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}
.empty-state .empty-icon {
    font-size: 56px;
    color: #cbd5e1;
    margin-bottom: 16px;
}
.empty-state h4 {
    font-size: 18px;
    color: #334155;
    margin-bottom: 4px;
}
.empty-state p {
    color: #64748b;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .top-header {
        padding: 0 16px;
    }
    .main-content {
        padding: 16px;
    }
    .page-title {
        font-size: 22px;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-wrapper {
        min-width: auto;
    }
    .filter-group {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }
    .filter-btn {
        white-space: nowrap;
    }
    .policy-table {
        font-size: 13px;
    }
    .policy-table th,
    .policy-table td {
        padding: 10px 12px;
    }
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    .page-numbers {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    .header-brand .brand-name {
        font-size: 16px;
    }
    .header-brand .brand-icon {
        font-size: 24px;
    }
    .sidebar {
        height: 100vh;
        overflow: hidden;
    }
    .sidebar-nav {
        flex: 1;
        min-height: 0;
    }
}

@media (max-width: 480px) {
    .top-header {
        padding: 0 12px;
    }
    .main-content {
        padding: 12px;
    }
    .sidebar {
        width: 280px;
    }
    .page-title {
        font-size: 18px;
    }
    .header-brand .brand-name {
        font-size: 14px;
    }
    .header-brand .brand-icon {
        font-size: 20px;
    }
    .policy-table {
        font-size: 12px;
    }
    .policy-table th,
    .policy-table td {
        padding: 8px 8px;
    }
}