@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Light Theme Palette */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    
    /* Accent Colors */
    --primary-emerald: #10b981;
    --primary-emerald-hover: #059669;
    --primary-emerald-light: #d1fae5;
    
    --primary-indigo: #6366f1;
    --primary-indigo-hover: #4f46e5;
    --primary-indigo-light: #e0e7ff;

    --sidebar-width: 260px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar General Styling */
.app-sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: #0f172a;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all 0.3s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.app-sidebar .brand-container {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-sidebar .brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.app-sidebar .brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.app-sidebar .nav-list {
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
}

.app-sidebar .nav-link-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.app-sidebar .nav-link-custom:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(2px);
}

.app-sidebar .nav-link-custom.active {
    color: #ffffff;
    font-weight: 600;
    background: var(--active-bg, linear-gradient(135deg, #10b981 0%, #059669 100%));
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.app-sidebar .nav-link-custom i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

.app-sidebar .sidebar-footer {
    margin-top: auto;
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Técnico / Admin Variant Sidebar */
.app-sidebar-tecnico .nav-link-custom.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Main Content Wrapper */
.main-wrapper {
    flex: 1;
    min-width: 0;
    padding: 2rem;
    background-color: var(--bg-body);
}

/* Topbar Header */
.top-header {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.025em;
    margin: 0;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

/* Custom Cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.stat-icon-emerald {
    background: #ecfdf5;
    color: #10b981;
}

.stat-icon-indigo {
    background: #eef2ff;
    color: #6366f1;
}

.stat-icon-amber {
    background: #fffbeb;
    color: #f59e0b;
}

.stat-icon-rose {
    background: #ffe4e6;
    color: #f43f5e;
}

.stat-icon-sky {
    background: #e0f2fe;
    color: #0284c7;
}

.stat-value {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-main);
    letter-spacing: -0.03em;
    margin-bottom: 0.4rem;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.825rem;
    font-weight: 600;
    text-decoration: none;
    margin-top: 0.8rem;
    transition: gap 0.2s ease;
}

.stat-link:hover {
    gap: 0.55rem;
}

/* Glass & Card Content Panels */
.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.75rem;
    overflow: hidden;
}

.panel-card .panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.panel-card .panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-card .panel-body {
    padding: 1.5rem;
}

/* Table Enhancements */
.table-custom {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.table-custom td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: #334155;
}

.table-custom tr:last-child td {
    border-bottom: none;
}

.table-custom tbody tr {
    transition: background-color 0.15s ease;
}

.table-custom tbody tr:hover {
    background-color: #f8fafc;
}

/* Custom Badges */
.badge-custom {
    padding: 0.35em 0.75em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-success-soft {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning-soft {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger-soft {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info-soft {
    background-color: #e0f2fe;
    color: #075985;
}

.badge-secondary-soft {
    background-color: #f1f5f9;
    color: #475569;
}

/* Forms & Buttons */
.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-emerald);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.app-sidebar-tecnico ~ .main-wrapper .form-control:focus,
.app-sidebar-tecnico ~ .main-wrapper .form-select:focus {
    border-color: var(--primary-indigo);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.btn {
    border-radius: 10px;
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-emerald {
    background-color: var(--primary-emerald);
    color: #ffffff;
    border: none;
}

.btn-emerald:hover {
    background-color: var(--primary-emerald-hover);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-indigo {
    background-color: var(--primary-indigo);
    color: #ffffff;
    border: none;
}

.btn-indigo:hover {
    background-color: var(--primary-indigo-hover);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Modals */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.75rem;
}

.modal-body {
    padding: 1.75rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.75rem;
}

/* Login Pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 1.5rem;
}

.auth-card {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1rem auto;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
