:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #64748b;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0a0a0a;
    --text-muted: #4b5563;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --glass-border: #e2e8f0;
    --sidebar-width: 260px;
}

/* Language Selector */
/* Language Switcher */
.lang-switch {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    padding: 0.25rem;
    gap: 0.25rem;
    border: 1px solid var(--glass-border);
}

.lang-switch a {
    padding: 0.4rem 1rem;
    border-radius: 0.6rem;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-switch a.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.lang-switch a:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.sidebar .lang-switch {
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar .lang-switch a {
    color: rgba(255, 255, 255, 0.5);
}

.sidebar .lang-switch a.active {
    background: var(--primary);
    color: white;
}

.sidebar .lang-switch a:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background: linear-gradient(to bottom right, #f1f5f9, #e2e8f0);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

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

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

.container {
    max-width: 100%;
    width: 100%;
    margin: 0;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #1e293b;
    color: white;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.logo-img {
    height: 60px !important;
    width: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
    display: block;
    margin: 0 auto;
}

.sidebar-logo {
    margin-bottom: 2rem;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.company-name-text {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    color: #a5b4fc;
    text-align: center;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(99, 102, 241, 0.2);
    color: white;
}

.sidebar-menu a.active {
    background: var(--primary);
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #ef4444;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

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

.btn-success {
    background: var(--success);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    transition: color 0.2s;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--text-main);
}

/* Table */
.table-container {
    overflow-x: auto;
    margin-top: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--glass-border);
    background: #f8fafc;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
}

tr:hover {
    background: #f8fafc;
}

/* Dashboard Widgets */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    border-radius: 1rem;
    background: #ffffff;
    border: 1px solid var(--glass-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-color: #10b981;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: #ef4444;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade {
    animation: fadeIn 0.5s ease forwards;
}

/* h1 */
h1 {
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Form responsivenes */
@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Navbar (top - for login page only) */
.navbar {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar .nav-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.sidebar .nav-links a {
    padding: 1rem 1.5rem;
    display: block;
    width: 100%;
}

.sidebar .nav-links a:hover,
.sidebar .nav-links a.active {
    background: rgba(99, 102, 241, 0.1);
    border-right: 4px solid var(--primary);
    color: var(--primary);
}

.navbar .nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
}

.navbar .nav-links a:hover {
    color: var(--primary);
}

.navbar .nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

/* Mobile Menu */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }

    .animate-fade>div[style*="display: flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }

    .animate-fade>div[style*="display: flex"] .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Off-Canvas Overlay */
.offcanvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 990;
    /* Right below sidebar at 1000 */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.offcanvas-overlay.show {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 769px) {
    .mobile-header {
        display: none !important;
    }

    .close-sidebar-btn {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important;
    }
}

.mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #ffffff;
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 90;
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Footer */
footer {
    margin-top: auto;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--glass-border);
    background: #ffffff;
}

/* Login page specific */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
}

.login-container .glass-card {
    margin-bottom: 0;
}

/* Responsive Card-like Tables for Mobile */
@media (max-width: 768px) {
    .table-container {
        overflow-x: visible !important;
        background: transparent;
        padding: 0;
        border: none;
    }

    .table-container table,
    .table-container tbody {
        display: block;
        width: 100%;
        border-collapse: collapse;
    }

    .table-container table thead {
        display: none;
        /* Hide standard headers */
    }

    .table-container table tr {
        display: block;
        margin-bottom: 1rem;
        background: #ffffff;
        border-radius: 0.75rem;
        padding: 0.5rem;
        border: 1px solid var(--glass-border);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    .table-container table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 0.75rem 0.5rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
        font-size: 0.9rem;
    }

    .table-container table td:last-child {
        border-bottom: none;
        justify-content: center;
        /* usually buttons */
        padding-top: 1rem;
    }

    /* Auto label injected via JS */
    .table-container table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        text-align: left;
        font-size: 0.75rem;
        text-transform: uppercase;
        margin-right: 1rem;
        flex-shrink: 0;
    }

    .table-container table td.no-records-cell {
        justify-content: center;
        color: var(--text-muted);
        font-weight: 500;
        padding: 2rem 1rem;
    }

    .table-container table td.no-records-cell::before {
        display: none;
    }

    /* Support inputs nicely on mobile list */
    .table-container table td input,
    .table-container table td select {
        max-width: 150px;
    }
}

/* Password Toggle Controls */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 5px;
    opacity: 0.6;
    transition: all 0.2s ease;
    z-index: 5;
}

.password-toggle:hover {
    opacity: 1;
    color: var(--primary);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}