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

/* --- Root Variables --- */
:root {
    --font-primary: 'Inter', sans-serif;
    --font-title: 'Outfit', sans-serif;

    /* Theme colors: Sleek Modern Dark Mode */
    --bg-main: #0a0d16;
    --bg-card: rgba(30, 41, 59, 0.45);
    --bg-card-hover: rgba(30, 41, 59, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(99, 102, 241, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --grad-secondary: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    --grad-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --grad-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --grad-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --grad-info: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --grad-dark: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);

    /* Glows */
    --glow-primary: 0 0 20px rgba(99, 102, 241, 0.25);
    --glow-success: 0 0 20px rgba(16, 185, 129, 0.25);
    --glow-warning: 0 0 20px rgba(245, 158, 11, 0.25);
    --glow-danger: 0 0 20px rgba(239, 68, 68, 0.25);

    --border-radius-sm: 8px;
    --border-radius-md: 14px;
    --border-radius-lg: 20px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.1) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(15, 23, 42, 0.8) 0px, var(--bg-main) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* --- Profile Switcher (Top Bar) --- */
.profile-switcher-bar {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.switcher-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.switcher-brand svg {
    color: #6366f1;
}

.switcher-title {
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.25rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.switcher-badge {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.switcher-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.current-user-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.current-user-info strong {
    color: var(--text-primary);
}

.switch-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.switch-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
}

.switch-select {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-smooth);
}

.switch-select:hover, .switch-select:focus {
    border-color: #818cf8;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.btn-switch-submit {
    background: var(--grad-primary);
    border: none;
    color: #white;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-switch-submit:hover {
    transform: translateY(-1px);
    box-shadow: var(--glow-primary);
}

/* --- Container / Layout --- */
.app-container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 24px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.app-title-wrapper h1 {
    font-size: 2.2rem;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-title-wrapper p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-logout:hover {
    background: #ef4444;
    color: #fff;
    box-shadow: var(--glow-danger);
    transform: translateY(-2px);
}

/* --- Flash Messages --- */
.messages-container {
    margin-bottom: 24px;
}

.alert-message {
    padding: 16px 20px;
    border-radius: var(--border-radius-md);
    margin-bottom: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(10px);
}

.alert-message.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-message.warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.alert-message.error, .alert-message.danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.6;
    transition: var(--transition-smooth);
}

.alert-close:hover {
    opacity: 1;
}

/* --- Card & Glassmorphism System --- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    transition: var(--transition-smooth);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    overflow: hidden;
    position: relative;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent
    );
    transition: 0.6s;
    pointer-events: none;
}

.glass-card:hover::before {
    left: 100%;
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 12px 40px 0 rgba(99, 102, 241, 0.08);
    transform: translateY(-2px);
}

.card-title {
    font-size: 1.4rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.card-title svg {
    color: #818cf8;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-control {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    padding: 12px 16px;
    outline: none;
    transition: var(--transition-smooth);
}

.form-control:focus {
    border-color: #818cf8;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.15);
}

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

.btn-primary {
    background: var(--grad-primary);
    color: #white;
    border: none;
    padding: 14px 28px;
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--glow-primary);
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

/* --- Badges & Indicators --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge.nova {
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(14, 165, 233, 0.3);
    color: #38bdf8;
}

.badge.aguardando_tecnico {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.badge.em_atendimento {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.badge.aguardando_info {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.badge.liberada_teste {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #22d3ee;
}

.badge.homologacao {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #c084fc;
}

.badge.concluida {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.badge.pausada {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.badge.alta {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.badge.media {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.badge.baixa {
    background: rgba(100, 116, 139, 0.2);
    border: 1px solid rgba(100, 116, 139, 0.4);
    color: #cbd5e1;
}

/* --- Grid System & Columns --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 992px) {
    .dashboard-grid.cols-2 {
        grid-template-columns: 380px 1fr;
    }
    .dashboard-grid.cols-3 {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* --- Demand list items --- */
.demand-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.demand-item {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    transition: var(--transition-smooth);
}

.demand-item:hover {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Highlight for PRD environment tasks */
.prd-highlight {
    border-color: rgba(249, 115, 22, 0.55) !important; /* Soft orange/red border */
    background: rgba(249, 115, 22, 0.08) !important; /* Soft orange background tint */
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.15) !important;
}
.prd-highlight:hover {
    border-color: rgba(249, 115, 22, 0.8) !important;
    background: rgba(249, 115, 22, 0.12) !important;
    box-shadow: 0 0 16px rgba(249, 115, 22, 0.25) !important;
}

.demand-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.demand-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.demand-meta span strong {
    color: var(--text-secondary);
}

.demand-body-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.detail-block {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 500;
}

.detail-value {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* --- Highlighted Active Work Panels --- */
.highlight-panel {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(30, 41, 59, 0.45) 100%);
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: var(--glow-primary);
}

.highlight-title {
    color: #a5b4fc;
}

/* --- Action Boxes (Interactive elements) --- */
.action-box {
    margin-top: 15px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-md);
}

.action-box-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-form-inline {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.action-form-inline input, .action-form-inline select {
    flex: 1;
}

.action-form-inline button {
    white-space: nowrap;
}

/* Button variants */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
}

.btn-success {
    background: var(--grad-success);
    color: #fff;
    box-shadow: var(--glow-success);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.45);
}

.btn-warning {
    background: var(--grad-warning);
    color: #fff;
    box-shadow: var(--glow-warning);
}

.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.45);
}

.btn-danger {
    background: var(--grad-danger);
    color: #fff;
    box-shadow: var(--glow-danger);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--border-radius-sm);
}

/* --- GP Priority List Reordering Styling --- */
.reorder-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reorder-item {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: grab;
    transition: var(--transition-smooth);
}

.reorder-item.dragging {
    opacity: 0.5;
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
}

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.drag-handle:active {
    cursor: grabbing;
}

.reorder-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.reorder-info {
    display: flex;
    flex-direction: column;
}

.reorder-client {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
}

.reorder-details {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.reorder-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-arrows {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.btn-arrow-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 26px;
    height: 26px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition-smooth);
}

.btn-arrow-control:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
    border-color: #6366f1;
}

/* --- Logs Audit Table --- */
.logs-table-wrapper {
    overflow-x: auto;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
    background: rgba(15, 23, 42, 0.3);
}

.logs-table th {
    background: rgba(15, 23, 42, 0.7);
    padding: 12px 18px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.logs-table td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.logs-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.logs-timestamp {
    color: var(--text-muted);
    white-space: nowrap;
}

.logs-user {
    font-weight: 600;
    color: #a5b4fc;
}

.logs-action {
    font-weight: 500;
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 500px;
    padding: 28px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: var(--transition-smooth);
}

.modal-overlay.open .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.modal-header h3 {
    font-size: 1.25rem;
    color: #fff;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.3rem;
}

.modal-close-btn:hover {
    color: #fff;
}

/* --- Login Page specific --- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 450px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo svg {
    color: #6366f1;
    margin-bottom: 10px;
}

.login-logo h1 {
    font-size: 1.8rem;
    color: #fff;
}

.test-accounts-section {
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.test-accounts-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 12px;
    text-align: center;
}

.test-accounts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.btn-test-login {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: center;
}

.btn-test-login:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
}

.test-login-name {
    font-size: 0.85rem;
    font-weight: 600;
    display: block;
}

.test-login-role {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* --- Forbidden Page --- */
.forbidden-container {
    text-align: center;
    max-width: 500px;
    margin: 100px auto;
}

.forbidden-icon {
    font-size: 4rem;
    color: #ef4444;
    margin-bottom: 20px;
}

/* --- Animations --- */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* --- Drag and Drop visual aids --- */
.reorder-item:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(30, 41, 59, 0.7);
}

.kanban-view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #818cf8;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.kanban-view-btn:hover {
    background: #6366f1;
    color: #fff;
}


/* ==========================================================================
   NEW STYLES: MODERN SIDEBAR LAYOUT & TIME SPENT SCREEN
   ========================================================================== */

/* Layout */
.app-layout {
    display: flex;
    min-height: calc(100vh - 57px); /* subtract top switcher bar height */
    width: 100%;
}

.sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: sticky;
    top: 57px;
    height: calc(100vh - 57px);
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.brand-text {
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.4rem;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.menu-item svg {
    width: 20px;
    height: 20px;
    transition: var(--transition-smooth);
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.menu-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: var(--glow-primary);
}

.menu-item.active svg {
    color: #818cf8;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 24px;
}

.user-avatar-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-title);
    font-size: 1.1rem;
    box-shadow: var(--glow-primary);
}

.user-meta-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

.user-display-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-logout-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.btn-logout-icon:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.app-main-content {
    flex-grow: 1;
    padding: 30px 40px;
    overflow-x: hidden;
    max-width: 1500px;
    width: 100%;
}

/* Override existing app-header for layout context */
.app-layout .app-header {
    margin-bottom: 30px;
}

/* Time Spent Page styling */
.time-spent-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.filter-card {
    padding: 24px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.filter-actions-row {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.filter-submit-btn, .filter-clear-btn {
    width: auto !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
}

.filter-clear-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--border-radius-md);
    font-weight: 600;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.filter-clear-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Metrics Banner */
.time-metrics-banner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px;
    margin: 0;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 20px;
}

.metric-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-md);
    background: rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.metric-info-text {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.8rem;
    font-family: var(--font-title);
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Modern Table */
.table-card {
    padding: 24px;
}

.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

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

.modern-table th {
    padding: 16px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.modern-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.modern-table tr:hover {
    background: rgba(255, 255, 255, 0.015);
}

.dema-id {
    display: block;
    font-weight: 700;
    color: #818cf8;
}

.dema-sensus {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.client-name {
    font-weight: 600;
}

.tech-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
}

.duration-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-block;
    color: var(--text-secondary);
}

.duration-badge.active {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.3);
    color: #38bdf8;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.1);
}

.activity-desc {
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

.btn-edit-period {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #818cf8;
    padding: 8px 14px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-edit-period:hover {
    background: #6366f1;
    color: #fff;
    box-shadow: var(--glow-primary);
    transform: translateY(-1px);
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    color: var(--text-muted);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 8, 16, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: 100%;
    max-width: 600px;
    margin: 20px;
    padding: 30px !important;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-color: rgba(255, 255, 255, 0.12);
}

.modal-overlay.visible .modal-card {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.modal-close-btn:hover {
    color: #fff;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 24px;
}

/* Responsive sidebar */
@media (max-width: 992px) {
    .app-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px 24px;
    }
    
    .sidebar-brand {
        padding-bottom: 12px;
        margin-bottom: 12px;
    }
    
    .sidebar-menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .menu-item {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .sidebar-footer {
        margin-top: 12px;
        padding-top: 12px;
    }
    
    .app-main-content {
        padding: 24px 16px;
    }
}
