:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --info: #4895ef;
    --warning: #f72585;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fb;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    color: white;
    padding: 20px 0;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
    z-index: 100;
}

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

.logo i {
    font-size: 28px;
    margin-right: 10px;
}

.logo h1 {
    font-size: 22px;
    font-weight: 700;
}

.menu-item {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    border-left: 4px solid transparent;
    text-decoration: none;
    color: white;
}

.menu-item:hover, .menu-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--success);
}

.menu-item i {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.menu-item span {
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-gray);
    gap: 20px;
}

.header-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
}

.header h2 {
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

.branch-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    padding: 10px 14px;
}

.branch-switcher label {
    font-size: 0.9rem;
    color: var(--gray);
    white-space: nowrap;
}

.branch-switcher select {
    min-width: 180px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--light-gray);
    background: #f8fafc;
    color: var(--dark);
    outline: none;
    transition: border-color 0.2s ease;
}

.branch-switcher select:focus {
    border-color: var(--primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.logout-link {
    margin-left: 16px;
    color: var(--primary);
    font-size: 12px;
    text-decoration: none;
    border: 1px solid var(--primary);
    padding: 6px 10px;
    border-radius: 8px;
    transition: var(--transition);
    background: white;
}

.logout-link:hover {
    background: var(--primary);
    color: white;
}

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
}

.auth-modal.hidden {
    display: none;
}

.auth-modal-content {
    width: min(420px, 100%);
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--box-shadow);
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.auth-modal-header h2 {
    font-size: 20px;
    margin: 0;
}

.auth-close {
    font-size: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--gray);
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.auth-tabs button {
    padding: 12px 10px;
    border: 1px solid var(--light-gray);
    background: transparent;
    cursor: pointer;
    border-radius: 12px;
    transition: var(--transition);
}

.auth-tabs button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.auth-error,
.auth-info {
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.4;
}

.auth-error {
    color: #d93025;
}

.auth-info {
    color: var(--gray);
}

.auth-form {
    display: grid;
    gap: 12px;
}

.auth-form.hidden {
    display: none;
}

.auth-form label {
    font-size: 14px;
    color: var(--gray);
}

.auth-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

.auth-form input:focus {
    border-color: var(--primary);
}

.auth-form .btn {
    width: 100%;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.card-footer {
    font-size: 14px;
    color: var(--gray);
    display: flex;
    align-items: center;
}

.card-footer i {
    margin-right: 5px;
}

.positive {
    color: #2ecc71;
}

.negative {
    color: #e74c3c;
}

/* Modules Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.module-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    transition: var(--transition);
    cursor: pointer;
    border-top: 4px solid var(--primary);
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.module-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--info));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    margin-bottom: 15px;
}

.module-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.module-description {
    color: var(--gray);
    font-size: 14px;
    line-height: 1.5;
}

/* Recent Activity */
.activity-list {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
}

.activity-item {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid var(--light-gray);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--primary);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.activity-time {
    font-size: 12px;
    color: var(--gray);
}

/* Form Styles */
.form-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    margin-bottom: 30px;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

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

.btn-secondary {
    background-color: #5c6ac4;
    color: white;
}

.btn-secondary:hover {
    background-color: #4f5bbf;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 20px 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: #000;
}

.video-container.hidden {
    display: none;
}

.video-preview {
    width: 100%;
    height: auto;
    display: block;
}

.camera-status {
    display: inline-block;
    margin-left: 12px;
    color: var(--gray);
    font-size: 14px;
}

.form-result {
    width: 100%;
}

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

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

/* Table Styles */
.table-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    margin-bottom: 30px;
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

.data-table th {
    background-color: var(--light);
    font-weight: 600;
    color: var(--dark);
}

.data-table tr:hover {
    background-color: rgba(67, 97, 238, 0.05);
}

/* Responsive */
@media (max-width: 992px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
    }
    
    .menu-items {
        display: flex;
        overflow-x: auto;
    }
    
    .menu-item {
        border-left: none;
        border-bottom: 4px solid transparent;
        white-space: nowrap;
    }
    
    .menu-item:hover, .menu-item.active {
        border-left: none;
        border-bottom: 4px solid var(--success);
    }
}

@media (max-width: 768px) {
    .dashboard-cards, .modules-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* Landing page */
.landing-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 60px;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(67, 97, 238, 0.16), transparent 30%),
                radial-gradient(circle at bottom right, rgba(72, 149, 239, 0.1), transparent 28%),
                linear-gradient(180deg, #edf4ff 0%, #fdfcff 100%);
}

.landing-page {
    width: min(1120px, 100%);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 36px;
    box-shadow: 0 32px 96px rgba(25, 79, 173, 0.12);
    padding: 48px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(67, 97, 238, 0.12);
}

.landing-page::before {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    top: -80px;
    right: -80px;
    background: rgba(67, 97, 238, 0.08);
    border-radius: 50%;
    filter: blur(28px);
}

.landing-page::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    bottom: -40px;
    left: -40px;
    background: rgba(72, 149, 239, 0.06);
    border-radius: 50%;
    filter: blur(16px);
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 36px;
    position: relative;
    z-index: 1;
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.landing-logo {
    width: 54px;
    height: 54px;
    display: block;
    cursor: pointer;
}

.landing-brand h2 {
    font-size: 1.45rem;
    margin: 0;
    color: #0f1f42;
}

.landing-brand p {
    margin: 0;
    color: #5a6d8c;
    font-size: 0.98rem;
    max-width: 420px;
}

.landing-access-note {
    margin-top: 10px;
    color: #637495;
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-form-note {
    margin-top: 16px;
    color: #5a6d8c;
    font-size: 0.9rem;
    text-align: center;
}

.landing-badges {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 700;
}

.landing-hero {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 34px;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.landing-copy {
    max-width: 650px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.88rem;
}

.landing-copy h1 {
    font-size: clamp(3rem, 4vw, 4.6rem);
    line-height: 1.02;
    margin-bottom: 24px;
    color: #0f1f42;
}

.landing-copy p {
    font-size: 1.08rem;
    color: #404f6d;
    line-height: 1.82;
    margin-bottom: 28px;
}

.landing-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.landing-buttons .btn-primary {
    padding: 16px 28px;
    font-size: 1rem;
    border-radius: 999px;
    box-shadow: 0 16px 32px rgba(67, 97, 238, 0.16);
}

.landing-trust {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, auto));
    gap: 12px;
    color: #4b5c77;
    font-size: 0.95rem;
    font-weight: 600;
}

.landing-trust span {
    background: #f4f7ff;
    padding: 12px 16px;
    border-radius: 16px;
}

.landing-visual {
    display: grid;
    gap: 20px;
}

.landing-visual-image {
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(67, 97, 238, 0.12);
    box-shadow: 0 22px 55px rgba(67, 97, 238, 0.08);
}

.landing-visual-image img {
    width: 100%;
    display: block;
}

.visual-card {
    border-radius: 28px;
    padding: 24px;
    background: white;
    border: 1px solid rgba(67, 97, 238, 0.1);
    box-shadow: 0 16px 40px rgba(67, 97, 238, 0.08);
}

.visual-card-top {
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
}

.visual-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1d3f7d;
    margin-bottom: 16px;
}

.visual-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: #0f1f42;
    margin-bottom: 8px;
}

.visual-label {
    color: #5a6d8c;
    font-size: 0.97rem;
}

.visual-card-bottom .visual-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    color: #3f506f;
}

.visual-card-bottom .visual-row span {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.95rem;
}

.visual-card-bottom .visual-row strong {
    font-size: 1.15rem;
    color: #0f1f42;
}

.visual-chart {
    height: 90px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.12), rgba(67, 97, 238, 0.03));
    position: relative;
    overflow: hidden;
}

.visual-chart::before,
.visual-chart::after {
    content: "";
    position: absolute;
    width: 120%;
    height: 8px;
    background: linear-gradient(90deg, transparent, rgba(67, 97, 238, 0.5), transparent);
    top: 50%;
    left: -10%;
    transform: translateY(-50%) rotate(15deg);
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 22px;
    margin-bottom: 34px;
    position: relative;
    z-index: 1;
}

.feature-card {
    background: white;
    border-radius: 26px;
    box-shadow: var(--box-shadow);
    padding: 28px;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(67, 97, 238, 0.08);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 55px rgba(67, 97, 238, 0.12);
}

.feature-card i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 18px;
}

.feature-card h3 {
    font-size: 1.12rem;
    margin-bottom: 12px;
    color: #12223f;
}

.feature-card p {
    color: #55617f;
    line-height: 1.75;
    font-size: 0.98rem;
}

.landing-steps {
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

.landing-steps h2 {
    font-size: 1.9rem;
    margin-bottom: 24px;
    color: #12223f;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 20px;
}

.step-card {
    background: white;
    border-radius: 28px;
    padding: 24px;
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(67, 97, 238, 0.08);
}

.step-number {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--info));
    color: white;
    border-radius: 50%;
    font-weight: 700;
    margin-bottom: 18px;
}

.step-card h3 {
    margin-bottom: 12px;
    font-size: 1rem;
    color: #0f1f42;
}

.step-card p {
    color: #55617f;
    line-height: 1.7;
}

@media (max-width: 1100px) {
    .landing-page {
        padding: 36px;
    }
}

@media (max-width: 992px) {
    .landing-hero {
        grid-template-columns: 1fr;
    }

    .landing-features,
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .landing-copy h1 {
        font-size: 2.6rem;
    }
}

@media (max-width: 600px) {
    .landing-page {
        padding: 26px 18px;
    }

    .landing-copy h1 {
        font-size: 2.2rem;
    }

    .whatsapp-float {
        right: 16px;
        bottom: 16px;
        padding: 12px 16px;
    }
}

/* Enhanced Landing Visuals */
.landing-visual-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.landing-visual-image img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(102, 126, 234, 0.2));
    animation: float 3s ease-in-out infinite;
}

.visual-card {
    position: absolute;
    background: white;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.2);
    border: 2px solid rgba(240, 147, 251, 0.3);
    animation: slideIn 0.8s ease 0.3s backwards;
}

.visual-card-top {
    top: 20px;
    left: 20px;
    width: 200px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(240, 147, 251, 0.05) 100%);
}

.visual-card-bottom {
    bottom: 20px;
    right: 20px;
    width: 220px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(240, 147, 251, 0.05) 100%);
}

.visual-status {
    font-size: 0.75rem;
    color: #764ba2;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.visual-value {
    font-size: 1rem;
    color: #0f1f42;
    font-weight: 700;
    margin-bottom: 8px;
}

.visual-label {
    font-size: 0.85rem;
    color: #404f6d;
    line-height: 1.5;
}

.visual-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.visual-row > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.visual-row span {
    font-size: 0.75rem;
    color: #764ba2;
    font-weight: 600;
    text-transform: uppercase;
}

.visual-row strong {
    font-size: 0.9rem;
    color: #0f1f42;
}

.visual-chart {
    height: 30px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 8px;
    opacity: 0.6;
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.landing-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.landing-brand h2 {
    margin: 0;
    color: #0f1f42;
    font-size: 1.8rem;
}

.landing-brand p {
    margin: 4px 0;
    color: #404f6d;
    font-size: 0.95rem;
}

.landing-access-note {
    color: #764ba2 !important;
    font-weight: 600;
    font-style: italic;
}

/* Guest Mode - hide sidebar menu but keep modal accessible */
body.guest-mode .sidebar {
    position: fixed;
    top: 20px;
    left: 20px;
    width: auto;
    background: transparent;
    box-shadow: none;
    padding: 0;
    z-index: 1000;
}

body.guest-mode .sidebar .logo {
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(102, 126, 234, 0.9);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

body.guest-mode .sidebar .logo:hover {
    background: rgba(102, 126, 234, 1);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
    transform: scale(1.1);
}

body.guest-mode .sidebar .logo i {
    margin: 0;
    font-size: 24px;
    color: white;
}

body.guest-mode .sidebar .logo h1 {
    display: none;
}

body.guest-mode .sidebar .menu-items {
    display: none;
}

body.guest-mode .container {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.guest-mode .main-content {
    padding: 0 !important;
    margin: 0 !important;
}

body.guest-mode .auth-modal {
    pointer-events: auto !important;
}
