/* ============================================
   LAIVE V2 - WEB DEMO STYLES
   Premium Industrial UI Design - Light Theme
   ============================================ */

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

:root {
    /* Paleta Laive - Yogurt Cremoso */
    --bg-cream: #FFFDF7;
    --bg-white: #FFFFFF;
    --bg-yellow-soft: #FEF9E7;
    --bg-yellow-accent: #FFF8DC;
    --bg-card: #FFFFFF;

    --color-primary: #D4A012;
    --color-primary-dark: #B8860B;
    --color-primary-light: #F5DEB3;
    --color-secondary: #C8102E;
    --color-warning: #F59E0B;
    --color-info: #0ea5e9;
    --color-success: #22c55e;

    --text-dark: #2D2A26;
    --text-medium: #5C5750;
    --text-light: #8C877D;

    --border: #EDE8DC;
    --border-light: #F5F2EB;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
}

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

/* Demo Banner */
.demo-banner {
    background: var(--color-primary);
    color: white;
    padding: 10px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.demo-banner__badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1px;
}

.app-container {
    margin-top: 48px;
    min-height: calc(100vh - 48px);
}

/* Screens */
.screen {
    display: none;
    min-height: calc(100vh - 48px);
}

.screen.active {
    display: flex;
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 48px);
    background: linear-gradient(180deg, var(--bg-white) 0%, var(--bg-cream) 100%);
    position: relative;
}

.login-container {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--color-primary);
}

.login-subtitle {
    color: var(--text-medium);
    font-size: 14px;
    margin-top: 8px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form__group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-form__group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-medium);
}

.login-form__group input {
    background: var(--bg-cream);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 15px;
    color: var(--text-dark);
    outline: none;
    transition: all 0.3s ease;
}

.login-form__group input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(212, 160, 18, 0.15);
}

.login-form__input-wrapper {
    position: relative;
}

.login-form__input-wrapper input {
    width: 100%;
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.toggle-password:hover {
    opacity: 1;
}

.login-form__submit {
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.login-form__submit:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 160, 18, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    color: var(--text-light);
    font-size: 12px;
}

/* ============================================
   HOME SCREEN
   ============================================ */
.home-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 48px);
    background: linear-gradient(180deg, var(--bg-white) 0%, var(--bg-cream) 100%);
    position: relative;
}

.home-bg-effects {
    display: none;
}

.home-content {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 40px;
    max-width: 500px;
    width: 100%;
}

.home-logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 24px;
}

.home-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.home-logo-glow {
    display: none;
}

.home-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.home-subtitle {
    color: var(--text-medium);
    font-size: 15px;
    margin-bottom: 40px;
}

.home-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.home-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.home-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-light);
}

.home-btn__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-yellow-accent);
    color: var(--color-primary);
}

.home-btn--secondary .home-btn__icon {
    background: #fef2f2;
    color: var(--color-secondary);
}

.home-btn--tertiary .home-btn__icon {
    background: #eff6ff;
    color: var(--color-info);
}

.home-btn__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.home-btn__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.home-btn__desc {
    font-size: 13px;
    color: var(--text-medium);
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-medium);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    color: var(--color-secondary);
    border-color: var(--color-secondary);
    background: #fef2f2;
}

.home-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
    color: var(--text-light);
    font-size: 13px;
}

/* ============================================
   PRODUCTION SCREEN
   ============================================ */
.production-screen {
    background: var(--bg-cream);
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Timer Section */
.timer-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 30px;
    box-shadow: var(--shadow-sm);
}

.timer-section__logo {
    width: 60px;
}

.logo-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.timer-section__center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.timer-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-cream);
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 600;
}

.timer-btn:hover {
    background: var(--border);
}

.timer-btn--home {
    background: var(--bg-cream);
}

.timer-btn--phase-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.timer-btn--finish {
    width: auto;
    padding: 0 16px;
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    font-weight: 600;
}

.timer-btn--finish:hover {
    background: var(--color-primary-dark);
    box-shadow: 0 4px 15px rgba(212, 160, 18, 0.3);
}

.timer-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 8px;
}

.timer {
    text-align: center;
}

.timer__label {
    display: block;
    font-size: 12px;
    color: var(--text-medium);
    margin-bottom: 4px;
}

.timer__value {
    font-size: 48px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-primary);
}

.timer-section__progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.progress-indicator {
    position: relative;
    width: 80px;
    height: 80px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__bg {
    stroke: var(--border);
}

.progress-ring__fill {
    stroke: var(--color-primary);
    transition: stroke-dashoffset 0.5s ease;
}

.progress-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary);
}

.phase-badge {
    background: var(--color-primary);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Progress Bar */
.progress-bar-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-bar-container {
    height: 12px;
    background: var(--bg-white);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border);
}

.progress-bar__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-warning));
    border-radius: 6px;
    transition: width 0.3s ease, background 0.3s ease;
}

.progress-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-medium);
    font-variant-numeric: tabular-nums;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    gap: 20px;
    flex: 1;
}

.left-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.divider-vertical {
    width: 1px;
    background: var(--border);
}

.right-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Operator Cards */
.operator-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.operator-card:hover {
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-md);
}

.operator-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.operator-card__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-yellow-accent);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
}

.operator-card__icon--blue {
    background: #eff6ff;
    color: var(--color-info);
}

.operator-card__icon--purple {
    background: #faf5ff;
    color: #9333ea;
}

.operator-card__info {
    flex: 1;
}

.operator-card__info h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-dark);
}

.operator-card__info span {
    font-size: 12px;
    color: var(--text-medium);
}

.operator-card__time {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
}

.operator-card__task {
    background: var(--bg-cream);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
    min-height: 42px;
    display: flex;
    align-items: center;
    color: var(--text-dark);
}

.operator-card__task--warning {
    background: #fef2f2;
    color: var(--color-secondary);
    border: 1px solid #fecaca;
}

.operator-card__progress {
    height: 4px;
    background: var(--bg-cream);
    border-radius: 2px;
    overflow: hidden;
}

.operator-card__progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-warning));
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Section Cards */
.section-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: 20px;
    flex: 1;
    box-shadow: var(--shadow-sm);
}

.section-card--red {
    border-left-color: var(--color-secondary);
}

.section-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.section-card__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-yellow-accent);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
}

.section-card--red .section-card__icon {
    background: #fef2f2;
    color: var(--color-secondary);
}

.section-card__header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.section-card__operators {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-operator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-cream);
    border-radius: var(--radius-sm);
}

.section-operator__name {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

.section-operator__task {
    font-size: 13px;
    color: var(--text-medium);
    text-align: right;
}

/* ============================================
   HISTORY SCREEN
   ============================================ */
.history-screen {
    background: var(--bg-cream);
    padding: 24px 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-header__left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: var(--border);
}

.history-logo {
    height: 48px;
    width: auto;
}

.history-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-title h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.history-title span {
    font-size: 13px;
    color: var(--text-medium);
}

/* KPI Cards */
.history-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.kpi-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.kpi-card__icon {
    font-size: 28px;
}

.kpi-card__content {
    display: flex;
    flex-direction: column;
}

.kpi-card__value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
}

.kpi-card--blue .kpi-card__value {
    color: var(--color-info);
}

.kpi-card--green .kpi-card__value {
    color: var(--color-success);
}

.kpi-card--red .kpi-card__value {
    color: var(--color-secondary);
}

.kpi-card--yellow .kpi-card__value {
    color: var(--color-primary);
}

.kpi-card__title {
    font-size: 13px;
    color: var(--text-medium);
    font-weight: 500;
}

.kpi-card__subtitle {
    font-size: 12px;
    color: var(--text-light);
}

/* History Table */
.history-table-container {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

.history-table th {
    background: var(--bg-cream);
    font-weight: 600;
    color: var(--text-medium);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-table td {
    color: var(--text-dark);
}

.history-table tbody tr:hover {
    background: var(--bg-yellow-soft);
}

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

.mode-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.mode-badge--green {
    background: #dcfce7;
    color: #166534;
}

.mode-badge--red {
    background: #fef2f2;
    color: #991b1b;
}

.status--success {
    color: var(--color-success);
    font-weight: 500;
}

.status--error {
    color: var(--color-secondary);
    font-weight: 500;
}

.efficiency-badge,
.grade-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

/* ============================================
   FINISH MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.finish-modal__header {
    text-align: center;
    margin-bottom: 28px;
}

.finish-modal__header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.finish-modal__stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-box {
    background: var(--bg-cream);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.stat-box--phase1 {
    border-left: 3px solid var(--color-primary);
}

.stat-box--phase2 {
    border-left: 3px solid var(--color-info);
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-medium);
    margin-bottom: 6px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-value--large {
    font-size: 32px;
}

.stat-target {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
}

.stat-divider {
    height: 1px;
    background: var(--border);
}

.stat-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-yellow-soft);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.stat-total__grade {
    font-size: 18px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    background: var(--color-success);
    color: white;
}

.finish-modal__btn {
    width: 100%;
    margin-top: 24px;
    padding: 16px;
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.finish-modal__btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .divider-vertical {
        display: none;
    }

    .history-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .left-panel {
        grid-template-columns: 1fr;
    }

    .timer-section {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .timer-section__logo {
        display: none;
    }

    .history-kpis {
        grid-template-columns: 1fr;
    }

    .history-table {
        font-size: 12px;
    }

    .history-table th,
    .history-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .app-container {
        margin-top: 40px;
    }

    .demo-banner {
        padding: 8px 12px;
        font-size: 12px;
    }

    .production-screen,
    .history-screen {
        padding: 16px;
    }

    .timer-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .timer__value {
        font-size: 36px;
    }
}