/* FlotaProLite - Styles */
:root {
    --sidebar-w: 260px;
    --topbar-h: 56px;
    --primary-color: #3b82f6;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #60a5fa;
    --primary-bg: #eff6ff;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #3b82f6;
    --content-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

[data-theme="dark"] {
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --content-bg: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--content-bg);
    color: var(--text-main);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    font-size: 28px;
}

.sidebar-brand {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: #fff;
}

.sidebar-link i {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.sidebar-user-name {
    color: var(--text-main);
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Main */
.main-content {
    margin-left: 260px;
    background-color: var(--content-bg);
    min-height: 100vh;
    transition: margin-left 0.3s ease, background-color 0.3s;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    height: var(--topbar-h);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-toggle {
    display: none;
    padding: 0;
    color: var(--text-muted);
}

.topbar-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-muted);
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-icon {
    color: var(--text-muted);
    font-size: 20px;
    padding: 6px;
    text-decoration: none;
}

.topbar-icon:hover {
    color: var(--primary-color);
}

.topbar-user {
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.topbar-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

/* Page */
.page-content {
    padding: 24px;
    flex: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

/* Cards */
.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Table card */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background-color: var(--card-bg);
    color: var(--text-main);
    transition: background-color 0.3s;
}

.card-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 600;
}

/* Modal */
.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff 0%, #ede9fe 100%);
}

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
}

.login-logo {
    text-align: center;
    font-size: 40px;
    margin-bottom: 8px;
}

.login-title {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.login-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 32px;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .topbar-toggle {
        display: block;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1035;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* DataTables override */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 12px;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 4px 8px;
}

/* WhatsApp button */
.btn-whatsapp {
    background: #25D366;
    color: #fff;
    border: none;
}

.btn-whatsapp:hover {
    background: #1da851;
    color: #fff;
}

/* Foto thumbnail */
.foto-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
}

/* Foto actions hover */
.foto-item .foto-actions {
    opacity: 0;
    transition: opacity 0.2s;
}

.foto-item:hover .foto-actions {
    opacity: 1;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.empty-state h5 {
    color: #6b7280;
}