:root {
    --sidebar-width: 280px;
    --header-height: 60px;
    --bg-dark: #0a0e14;
    --bg-panel: rgba(22, 27, 34, 0.85);
    --bg-panel-solid: #161b22;
    --bg-elevated: rgba(33, 38, 45, 0.9);
    --bg-hover: #30363d;
    --accent: #2ea043;
    --accent-bright: #3fb950;
    --accent-glow: rgba(46, 160, 67, 0.35);
    --accent-soft: rgba(46, 160, 67, 0.12);
    --text: #e6edf3;
    --text-muted: #8b949e;
    --border: rgba(48, 54, 61, 0.8);
    --success: #2ea043;
    --warning: #d29922;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 20px;
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --shadow: 0 8px 32px rgba(0,0,0,0.35);
    --shadow-glow: 0 0 40px rgba(46, 160, 67, 0.08);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@keyframes bgShift {
    0%, 100% { opacity: 0.6; transform: scale(1) translate(0, 0); }
    33% { opacity: 0.8; transform: scale(1.05) translate(2%, -2%); }
    66% { opacity: 0.5; transform: scale(0.98) translate(-1%, 1%); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

body {
    font-family: var(--font);
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-bright);
    text-decoration: none;
}

.layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.layout::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse 120% 80% at 20% 0%, rgba(46, 160, 67, 0.12) 0%, transparent 50%), radial-gradient(ellipse 80% 120% at 80% 100%, rgba(88, 101, 242, 0.08) 0%, transparent 45%), radial-gradient(ellipse 60% 60% at 50% 50%, rgba(46, 160, 67, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

.layout::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46, 160, 67, 0.06) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    z-index: 0;
    animation: bgShift 18s var(--ease-in-out) infinite;
    pointer-events: none;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-panel-solid);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: box-shadow 0.4s var(--ease-out);
}

.sidebar:hover {
    box-shadow: 4px 0 24px rgba(0,0,0,0.2);
}

.sidebar-brand {
    padding: 20px 16px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand .brand-icon {
    width: 28px;
    height: 28px;
    color: var(--accent);
    flex-shrink: 0;
}

.sidebar-brand .brand-icon svg {
    width: 100%;
    height: 100%;
}

.sidebar-brand .brand-accent {
    color: var(--accent);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.sidebar-nav .nav-item,
.sidebar-nav .nav-item-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: var(--radius);
    background: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out), transform 0.2s var(--ease-out);
}

.sidebar-nav .nav-item-toggle {
    margin-bottom: 0;
}

.sidebar-nav .nav-item:hover,
.sidebar-nav .nav-item-toggle:hover {
    background: var(--bg-hover);
    color: var(--text);
    transform: translateX(2px);
}

.sidebar-nav .nav-item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    transition: color 0.2s;
}

.sidebar-nav .nav-item-icon svg {
    width: 100%;
    height: 100%;
}

.sidebar-nav .nav-item-label {
    flex: 1;
}

.sidebar-nav .nav-item-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: transform 0.2s;
}

.sidebar-nav .nav-item-arrow svg {
    width: 100%;
    height: 100%;
}

.sidebar-nav .nav-section.open .nav-item-arrow {
    transform: rotate(180deg);
}

.sidebar-nav .nav-item.active {
    background: var(--accent-soft);
    color: var(--accent-bright);
    font-weight: 600;
}

.sidebar-nav .nav-item.active .nav-item-icon {
    color: var(--accent-bright);
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

.sidebar-nav .nav-badge {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 2px;
}

.nav-sub {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
}

.sidebar-nav .nav-section.open .nav-sub {
    max-height: 280px;
}

.nav-sub-item {
    display: block;
    padding: 8px 14px 8px 46px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    margin: 2px 0;
    transition: background 0.2s, color 0.2s;
}

.nav-sub-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.nav-sub-item.active {
    background: var(--accent-soft);
    color: var(--accent-bright);
    font-weight: 600;
    border-left: 3px solid var(--accent-bright);
    padding-left: 43px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sidebar-footer-user {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.sidebar-footer-role {
    margin-bottom: 8px;
}

.sidebar-footer-logout {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.sidebar-footer-logout:hover {
    color: var(--accent);
}

.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.header {
    height: var(--header-height);
    background: rgba(22, 27, 34, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    animation: fadeIn 0.4s var(--ease-out);
}

.header h1 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.header-user .role-badge {
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: var(--radius-pill);
    background: var(--accent-soft);
    color: var(--accent-bright);
    font-weight: 500;
}

.header-group {
    color: var(--text-muted);
}

.content {
    flex: 1;
    padding: 28px;
    animation: fadeInUp 0.5s var(--ease-out);
}

.card {
    background: var(--bg-panel);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
    animation: fadeInUp 0.5s var(--ease-out) backwards;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }

.card:hover {
    box-shadow: var(--shadow), var(--shadow-glow);
    border-color: rgba(46, 160, 67, 0.2);
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.25s var(--ease-out), transform 0.2s var(--ease-out), box-shadow 0.25s var(--ease-out);
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-bright);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    filter: brightness(1.1);
}

.btn-danger {
    background: rgba(248, 81, 73, 0.2);
    color: #ff7b72;
    border: 1px solid rgba(248, 81, 73, 0.4);
}

.btn-danger:hover {
    background: rgba(248, 81, 73, 0.35);
    color: #ff7b72;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-row-pair {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.form-row-pair .form-row-fields {
    flex: 1;
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px;
}

.form-row-pair .btn-remove-row {
    flex-shrink: 0;
    width: 32px;
    padding: 0;
    font-size: 1.2rem;
    line-height: 1;
}

.modal-form-create .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

@media (max-width: 480px) {
    .form-row-pair .form-row-fields {
        grid-template-columns: 1fr;
    }
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 100% 80% at 50% 0%, rgba(46, 160, 67, 0.15) 0%, transparent 50%), radial-gradient(ellipse 80% 100% at 80% 80%, rgba(88, 101, 242, 0.1) 0%, transparent 45%);
    animation: bgShift 20s var(--ease-in-out) infinite;
    pointer-events: none;
}

.auth-box {
    width: 100%;
    max-width: 400px;
    background: rgba(22, 27, 34, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow), 0 0 60px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s var(--ease-out);
}

.auth-box h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    text-align: center;
    color: var(--text);
}

.auth-box .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 24px;
}

.auth-box .form-group:last-of-type {
    margin-bottom: 20px;
}

.auth-box .btn {
    width: 100%;
    padding: 12px;
}

.auth-box .footer-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-elevated);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background 0.2s var(--ease-out);
}

tr:hover td {
    background: rgba(255,255,255,0.03);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-pill);
}

.badge-pending {
    background: rgba(210, 153, 34, 0.2);
    color: var(--warning);
}

.badge-approved {
    background: var(--accent-soft);
    color: var(--accent-bright);
}

.badge-gs {
    background: var(--accent-soft);
    color: var(--accent-bright);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.tile {
    background: var(--bg-panel);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
    animation: fadeInUp 0.5s var(--ease-out) backwards;
}

.tile:nth-child(1) { animation-delay: 0.08s; }
.tile:nth-child(2) { animation-delay: 0.14s; }
.tile:nth-child(3) { animation-delay: 0.2s; }

.tile:hover {
    border-color: var(--accent);
    text-decoration: none;
    color: inherit;
    transform: translateY(-4px);
    box-shadow: var(--shadow), 0 0 24px rgba(46, 160, 67, 0.15);
}

.tile h3 {
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--text);
}

.tile p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(16px);
    }
}

.alert {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid transparent;
    box-shadow: var(--shadow);
    animation: toastIn 0.4s var(--ease-out);
    position: relative;
}

.alert.alert-dismissed {
    animation: toastOut 0.3s var(--ease-out) forwards;
}

.alert::before {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
}

.alert-message {
    flex: 1;
}

.alert-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: rgba(255,255,255,0.12);
    color: inherit;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: opacity 0.2s, background 0.2s;
}

.alert-close:hover {
    opacity: 1;
    background: rgba(255,255,255,0.2);
}

.alert-error {
    background: linear-gradient(135deg, rgba(248, 81, 73, 0.18) 0%, rgba(248, 81, 73, 0.08) 100%);
    border-color: rgba(248, 81, 73, 0.35);
    color: #ff7b72;
}

.alert-error::before {
    content: '✕';
    background: rgba(248, 81, 73, 0.25);
    color: #ff7b72;
}

.alert-success {
    background: linear-gradient(135deg, rgba(46, 160, 67, 0.2) 0%, rgba(46, 160, 67, 0.06) 100%);
    border-color: rgba(46, 160, 67, 0.4);
    color: #3fb950;
}

.alert-success::before {
    content: '✓';
    background: rgba(46, 160, 67, 0.3);
    color: #3fb950;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(210, 153, 34, 0.18) 0%, rgba(210, 153, 34, 0.06) 100%);
    border-color: rgba(210, 153, 34, 0.4);
    color: #e3b341;
}

.alert-warning::before {
    content: '!';
    background: rgba(210, 153, 34, 0.3);
    color: #e3b341;
}

.task-row {
    display: grid;
    grid-template-columns: 1fr 100px 1fr 1fr 120px;
    gap: 12px;
    align-items: start;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.task-row:last-child {
    border-bottom: none;
}

.task-row .task-name { font-weight: 500; }
.task-row .task-num { color: var(--text-muted); }
.task-row label { color: var(--text-muted); font-size: 0.8rem; }

@media (max-width: 900px) {
    .task-row {
        grid-template-columns: 1fr 1fr;
    }
}

.payment-table td:nth-child(2),
.payment-table td:nth-child(4) {
    font-weight: 600;
    color: var(--accent-bright);
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.modal {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 1.2rem;
}

.modal-close:hover {
    color: var(--text);
}

.forms-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-block-inner {
    padding: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.form-block-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-block-nicks {
    font-weight: 600;
    color: var(--text);
}

.form-block-text {
    margin: 0 0 16px 0;
    padding: 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

.form-block-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge-pending {
    background: rgba(210, 153, 34, 0.2);
    color: #e3b341;
    border: 1px solid rgba(210, 153, 34, 0.4);
}

.status-badge-approved {
    background: var(--accent-soft);
    color: var(--accent-bright);
    border: 1px solid rgba(46, 160, 67, 0.4);
}

.status-badge-rejected {
    background: rgba(248, 81, 73, 0.15);
    color: #ff7b72;
    border: 1px solid rgba(248, 81, 73, 0.35);
}

.form-preview-cell {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-reject-cell {
    max-width: 240px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.link-video {
    word-break: break-all;
}

.archive-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: -8px 0 16px 0;
}

.archive-date-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.archive-date-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.archive-date-label .form-control {
    width: auto;
    min-width: 140px;
}

.archive-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin: 0 0 24px 0;
}

.archive-tab {
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}

.archive-tab:hover {
    color: var(--text);
}

.archive-tab.active {
    color: var(--text);
    border-bottom-color: #a371f7;
}

.archive-group {
    margin-bottom: 32px;
}

.archive-group:last-child {
    margin-bottom: 0;
}

.archive-group-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.archive-week {
    margin-bottom: 24px;
    padding-left: 0;
}

.archive-week:last-child {
    margin-bottom: 0;
}

.archive-week-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.archive-week .table-wrap {
    margin-bottom: 0;
}

.profile-link {
    font-weight: 500;
    color: var(--accent-bright);
}

.profile-link:hover {
    text-decoration: underline;
}

.profile-hero {
    position: relative;
    margin: -28px -28px 28px -28px;
    padding: 48px 28px 80px;
    background: linear-gradient(135deg, rgba(46, 160, 67, 0.25) 0%, rgba(22, 27, 34, 0.95) 50%, rgba(88, 101, 242, 0.15) 100%);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
    animation: fadeIn 0.5s var(--ease-out);
}

.profile-cover {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(46, 160, 67, 0.2) 0%, transparent 60%), linear-gradient(180deg, transparent 0%, rgba(10, 14, 20, 0.4) 100%);
    pointer-events: none;
}

.profile-avatar-wrap {
    position: relative;
    margin: 0 auto 20px;
    width: 100px;
    height: 100px;
}

.profile-avatar,
.profile-avatar-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.15);
    box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.05);
    object-fit: cover;
}

.profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text);
    background: linear-gradient(145deg, rgba(46, 160, 67, 0.4), rgba(35, 134, 54, 0.5));
    animation: fadeInUp 0.5s var(--ease-out) 0.2s backwards;
}

.profile-avatar-form {
    position: absolute;
    bottom: -4px;
    right: -4px;
}

.profile-avatar-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.profile-avatar-upload {
    cursor: pointer;
    display: inline-block;
}

.profile-last-actions .card-title {
    margin-bottom: 12px;
}

.profile-activity-item {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.profile-activity-item:last-child {
    margin-bottom: 0;
}

.profile-meta {
    position: relative;
    text-align: center;
    animation: fadeInUp 0.5s var(--ease-out) 0.25s backwards;
}

.profile-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.profile-role,
.profile-group,
.profile-status {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
}

.profile-role-gs_mapping {
    background: linear-gradient(135deg, rgba(46, 160, 67, 0.35), rgba(46, 160, 67, 0.2));
    color: var(--accent-bright);
    border: 1px solid rgba(46, 160, 67, 0.4);
}

.profile-role-employee {
    background: rgba(88, 101, 242, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(88, 101, 242, 0.3);
}

.profile-role-unapproved {
    background: rgba(139, 148, 158, 0.2);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.profile-group {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.1);
}

.profile-status-approved {
    background: rgba(46, 160, 67, 0.2);
    color: var(--accent-bright);
}

.profile-status-pending {
    background: rgba(210, 153, 34, 0.2);
    color: var(--warning);
}

.profile-joined {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    animation: fadeInUp 0.5s var(--ease-out) 0.3s backwards;
}

.profile-stat {
    background: var(--bg-panel);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.profile-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.profile-stat-accent {
    border-color: rgba(46, 160, 67, 0.3);
    background: linear-gradient(180deg, rgba(46, 160, 67, 0.08) 0%, var(--bg-panel) 100%);
}

.profile-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.profile-stat-accent .profile-stat-value {
    color: var(--accent-bright);
}

.profile-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.profile-actions.card {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    animation: fadeInUp 0.5s var(--ease-out) 0.35s backwards;
}

.journal-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 12px;
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 150;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle::before {
    content: '';
    width: 20px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 101;
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s var(--ease-out);
    }

    .layout.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .layout.sidebar-open .sidebar-overlay {
        display: block;
    }

    .main {
        margin-left: 0;
        padding-top: 56px;
    }

    .header {
        padding-left: 60px;
    }

    .content {
        padding: 16px;
    }

    .card {
        padding: 16px;
    }

    .table-wrap {
        margin: 0 -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .profile-hero {
        margin: -16px -16px 24px -16px;
        padding: 32px 16px 60px;
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 1.75rem;
    }

    .profile-name {
        font-size: 1.4rem;
    }

    .profile-stats {
        grid-template-columns: 1fr;
    }

    .archive-date-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .archive-date-label .form-control {
        min-width: 0;
    }
}
