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

:root {
    --bg-color: #121212;
    --bg-surface: #1e1e1e;
    --bg-surface-glass: rgba(30, 30, 30, 0.7);
    --primary: #00e676;
    --primary-dark: #00b25c;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: #333333;
    --danger: #cf6679;
    --warning: #ffb74d;
    --info: #64b5f6;
    --glass-border: rgba(255, 255, 255, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --form-bg: #2a2a2a;
    --hover-bg: #2a2a2a;
    --tr-hover: rgba(255, 255, 255, 0.02);
    --primary-text: var(--primary);
    
    /* Variables for glassmorphism panels & inputs */
    --glass-bg: rgba(255, 255, 255, 0.02);
    --input-bg: rgba(255, 255, 255, 0.04);
    --input-bg-focus: rgba(0, 230, 118, 0.05);

    /* Sidebar Variables */
    --sidebar-bg: var(--bg-surface);
    --sidebar-text: var(--text-main);
    --sidebar-text-muted: var(--text-muted);
    --sidebar-border: var(--border-color);
    --sidebar-hover-bg: color-mix(in srgb, var(--primary) 8%, transparent);
}

html.light-theme {
    --bg-color: #f0f4f8;
    --bg-surface: #ffffff;
    --bg-surface-glass: rgba(255, 255, 255, 0.85);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --glass-border: rgba(255, 255, 255, 0.5);
    --form-bg: #ffffff;
    --hover-bg: #f1f5f9;
    --tr-hover: rgba(0, 0, 0, 0.02);
    --primary-text: #00994d;

    /* Light Theme variants for panels & inputs */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --input-bg: #f8fafc;
    --input-bg-focus: #e8f5e9;

    /* Sidebar Variables (Dark glass in Light Theme) */
    --sidebar-bg: rgba(15, 23, 42, 0.85);
    --sidebar-text: #f8fafc;
    --sidebar-text-muted: #94a3b8;
    --sidebar-border: rgba(255, 255, 255, 0.1);
    --sidebar-hover-bg: rgba(255, 255, 255, 0.05);
}

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

/* Print styles moved to app.blade.php for better control */
@media print {
    .no-print, .sidebar, .btn, .footer, .mobile-header, .tabs, .user-card, .nav-section-title {
        display: none !important;
        visibility: hidden !important;
    }
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-main);
}

a {
    color: var(--primary-text);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    background: var(--sidebar-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}
@media (min-width: 992px) {
    .sidebar {
        width: 250px;
        position: fixed;
        height: 100vh;
    }
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sidebar-text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar .logo span {
    color: var(--primary-text);
}

.nav-links {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(128, 128, 128, 0.3) transparent;
}

.nav-links::-webkit-scrollbar {
    width: 4px;
}

.nav-links::-webkit-scrollbar-track {
    background: transparent;
}

.nav-links::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.3);
    border-radius: 10px;
}

.nav-links::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.6);
}

.nav-links a,
.nav-links button {
    color: var(--sidebar-text-muted);
    font-weight: 500;
    padding: 11px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid transparent;
    border-radius: 0;
    text-align: left;
    background: transparent;
    border-top: none;
    border-bottom: none;
    border-right: none;
    width: 100%;
    cursor: pointer;
    font-size: 0.92rem;
    text-decoration: none;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links button:hover,
.nav-links a.active {
    color: var(--sidebar-text);
    background: var(--sidebar-hover-bg);
    border-left-color: var(--primary);
}

.main-content {
    flex: 1;
    min-height: 100vh;
    padding: 24px;
    transition: var(--transition);
}
@media (min-width: 992px) {
    .main-content {
        margin-left: 250px;
        width: calc(100% - 250px);
    }
}

.footer {
    text-align: center;
    padding: 20px;
    background: transparent;
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer strong {
    color: var(--primary-text);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    border: none;
    outline: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #000;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.4);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: var(--hover-bg);
    border-color: var(--text-main);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b00020;
}

.btn-warning {
    background: var(--warning);
    color: #000;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    background: var(--form-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    color: var(--text-main) !important;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    width: 100%;
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

select.form-control {
    color: var(--text-main) !important;
}

select.form-control option {
    background-color: var(--bg-surface);
    color: var(--text-main);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.2);
    outline: none;
}

textarea.form-control {
    resize: vertical;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

tr:hover {
    background: var(--tr-hover);
}

/* Dashboard */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.dash-card {
    text-align: center;
    padding: 24px 16px;
}

.dash-card h3 {
    font-size: 2.5rem;
    color: var(--primary-text);
    margin-bottom: 8px;
}

.dash-card p {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.tab {
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    white-space: nowrap;
}

.tab:hover,
.tab.active {
    color: var(--primary-text);
    background: rgba(0, 230, 118, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Utilities */
.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.text-center {
    text-align: center;
}

.flex {
    display: flex;
}

.gap-2 {
    gap: 16px;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

/* Mobile Header */
.mobile-header {
    display: none;
    padding: 14px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    justify-content: space-between;
}

.mobile-header-btn {
    background: transparent;
    border: none;
    color: var(--primary-text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Profile */
.profile-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary);
    flex-shrink: 0;
}

.profile-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--form-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted);
    border: 4px solid var(--border-color);
    flex-shrink: 0;
}

/* Mobile cards */
.mobile-card {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.mobile-card:last-child {
    border-bottom: none;
}

.mobile-card:hover {
    background: rgba(0, 230, 118, 0.03);
}

/* Show/Hide utilities */
.show-mobile {
    display: none;
}

.hide-mobile {
    display: block;
}

/* Camera Preview */
.camera-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    background: #000;
}

.camera-container video,
.camera-container canvas {
    width: 100%;
    display: block;
    border-radius: 10px;
}

.camera-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    border: 1px solid var(--primary);
    background: rgba(0, 230, 118, 0.1);
    color: var(--primary-text);
    transition: var(--transition);
}

.camera-btn:hover {
    background: var(--primary);
    color: #000;
}

.camera-preview-img {
    max-width: 200px;
    border-radius: 8px;
    border: 2px solid var(--primary);
    margin-top: 8px;
}



/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
        width: 100%;
        padding: 16px;
    }

    .mobile-header {
        display: flex;
    }

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

    .app-wrapper {
        flex-direction: column;
    }

    .main-dash-layout {
        grid-template-columns: 1fr !important;
    }

    .dash-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .dash-card h3 {
        font-size: 2rem;
    }

    .tabs {
        gap: 4px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        padding: 8px 12px;
        font-size: 0.82rem;
        flex-shrink: 0;
    }

    h2 {
        font-size: 1.3rem;
    }

    th,
    td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }

    .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    /* Mobile show/hide */
    .show-mobile {
        display: block;
    }

    .hide-mobile {
        display: none;
    }

    /* Profile stacking */
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-avatar,
    .profile-avatar-placeholder {
        width: 100px;
        height: 100px;
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }

    .glass-panel {
        padding: 14px;
    }

    .main-content {
        padding: 10px;
    }

    .profile-avatar,
    .profile-avatar-placeholder {
        width: 80px;
        height: 80px;
        font-size: 1.8rem;
    }
}

.widget-card {
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

.widget-card:hover {
    transform: translateY(-5px) !important;
    background: color-mix(in srgb, var(--primary) 12%, var(--bg-surface-glass)) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px color-mix(in srgb, var(--primary) 20%, transparent) !important;
}