:root {
    --bg: #f7f8fa;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --primary: #2563eb;
    --border: #e5e7eb;
}

body {
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 24px;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #001432 0%, #102A46 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.brand-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.sidebar-brand {
    font-size: 18px;
    font-weight: 700;
    color: #001936;
    line-height: 1.2;
}

.sidebar-tagline {
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    padding: 0 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 2px;
    color: #475569;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
}

body.role-client a,
body.role-client a:hover,
body.role-client a:focus {
    text-decoration: none;
}

.nav-item:hover {
    background: #f1f5f9;
    color: #001936;
}

.nav-item.active {
    background: #001936;
    color: #ffffff;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #001432 0%, #102A46 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    text-transform: capitalize;
}

.user-email {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content {
    padding: 20px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

h1 {
    margin-top: 0;
}

label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
}

input, textarea, select {
    width: 100%;
    padding: 10px 12px;
    margin-top: 6px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.progress {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.progress-step {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 999px;
}

.progress-step.active {
    background: var(--primary);
}

.helper {
    color: var(--muted);
    font-size: 14px;
}

.actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

/* Global responsive helpers */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 640px;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 1024px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .content {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 24px auto;
        padding: 16px;
    }

    .topbar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .topbar .inline-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .actions,
    .inline-actions,
    .form-actions {
        width: 100%;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .actions button,
    .actions a,
    .inline-actions button,
    .inline-actions a,
    .form-actions button,
    .form-actions a {
        width: 100%;
    }

    .progress {
        flex-direction: column;
        gap: 8px;
    }

    table {
        min-width: 640px;
    }
}

@media (max-width: 480px) {
    .topbar span {
        font-size: 13px;
    }

    .nav-item {
        padding: 10px 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}
