@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap');

:root {
    /* Enterprise Palette */
    --sidebar-bg: #0F1624;
    --main-bg: #F8F7F4;
    --accent: #B8962E;
    --accent-light: rgba(184, 150, 46, 0.1);
    --text-main: #1A1A1A;
    --text-muted: #9B9891;
    --border: #E5E3DF;
    --border-light: #F3F2EF;

    /* Semantic Colors (Dot Indicators) */
    --status-pending: #9B9891;
    --status-progress: #2C5F8A;
    --status-overdue: #C0392B;
    --status-done: #27AE60;

    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--main-bg);
    color: var(--text-main);
    line-height: 1.6;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
}

/* --- Layout Structure --- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar Navigation --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.sidebar-header {
    padding: 32px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-text {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.nav-menu {
    flex: 1;
    padding: 24px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.5;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.02);
}

.nav-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--accent);
    font-weight: 500;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    max-width: calc(100vw - var(--sidebar-width));
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 8px;
}

.page-header p {
    font-size: 14px;
    color: var(--text-muted);
}

/* --- Metric Cards --- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.metric-card {
    background: white;
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 12px;
    position: relative;
    transition: border-color 0.2s ease;
}

.metric-card:hover {
    border-color: var(--accent);
}

.metric-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: block;
}

.metric-value {
    font-size: 32px;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1;
}

.metric-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
}

/* --- Filter Bar --- */
.filter-bar {
    background: white;
    border: 1px solid var(--border);
    padding: 8px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 0;
}

.filter-group {
    padding: 12px 20px;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

.filter-group:last-child {
    border-right: none;
}

.filter-group label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.filter-bar input,
.filter-bar select {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-main);
    outline: none;
    -webkit-appearance: none;
}

.search-input {
    width: 220px;
}

.btn-apply {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-left: auto;
    margin-right: 8px;
}

/* --- Data Table --- */
.table-container {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

thead {
    background: var(--border-light);
}

th {
    padding: 16px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

tr {
    border-bottom: 1px solid var(--border-light);
}

tr:last-child {
    border-bottom: none;
}

tr:hover {
    background: #FAFAF8;
}

td {
    padding: 16px 20px;
    font-size: 13px;
    color: var(--text-main);
    vertical-align: middle;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-pending {
    color: var(--status-pending);
}

.badge-pending .dot {
    background: var(--status-pending);
}

.badge-progress {
    color: var(--status-progress);
}

.badge-progress .dot {
    background: var(--status-progress);
}

.badge-overdue {
    color: var(--status-overdue);
}

.badge-overdue .dot {
    background: var(--status-overdue);
}

.badge-done {
    color: var(--status-done);
}

.badge-done .dot {
    background: var(--status-done);
}

/* Action Buttons */
.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color 0.1s ease;
}

.icon-btn:hover {
    color: var(--accent);
}

.icon-btn svg {
    width: 16px;
    height: 16px;
}

/* Responsive Mobile Layout */
@media (max-width: 1024px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 0;
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
        max-width: 100%;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }

    .btn-apply {
        margin-left: 8px;
        margin-top: 12px;
    }

    /* Card List for Mobile Instead of Table */
    .table-container {
        border: none;
        background: transparent;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        background: white;
        border: 1px solid var(--border);
        border-radius: 12px;
        margin-bottom: 16px;
        padding: 16px;
    }

    td {
        padding: 8px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
    }

    td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 500;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .action-cell {
        justify-content: flex-end;
        padding-top: 16px;
        border-top: 1px solid var(--border-light);
        margin-top: 8px;
    }
}

/* Skeleton Loading Animation */
.skeleton {
    background: linear-gradient(90deg, #F3F2EF 25%, #E5E3DF 50%, #F3F2EF 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

.empty-state {
    padding: 80px 20px;
    text-align: center;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--border);
    margin-bottom: 16px;
    stroke-width: 1;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
}