/* ==========================================================================
   CSS DESIGN SYSTEM: ProSync Shift Production Data Entry App
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES & FOUNDATIONS
   -------------------------------------------------------------------------- */
:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(15, 23, 42, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(6, 182, 212, 0.15);
    
    /* Premium Tailored HSL Colors */
    --primary: #06b6d4;      /* Cyan - main brand action */
    --primary-glow: rgba(6, 182, 212, 0.4);
    --secondary: #3b82f6;    /* Blue - secondary operations */
    --success: #10b981;      /* Emerald - approvals, positive numbers */
    --warning: #f59e0b;      /* Amber - pending states, summaries */
    --danger: #ef4444;       /* Rose - scrap, deletions */
    --danger-bg: rgba(239, 68, 68, 0.1);
    
    /* Text Palette */
    --text-primary: #f8fafc;   /* White / high-contrast text */
    --text-secondary: #94a3b8; /* Slate gray / metadata */
    --text-muted: #64748b;     /* Darker slate / helper text */
    
    /* Layout Configurations */
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-quick: all 0.15s ease-in-out;
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-neon: 0 0 15px rgba(6, 182, 212, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

input, select, textarea, button {
    font-family: inherit;
    color: inherit;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* --------------------------------------------------------------------------
   2. DESKTOP VIEW WRAPPER & TOGGLE FRAME
   -------------------------------------------------------------------------- */
.app-viewport-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(circle at top right, rgba(6, 182, 212, 0.08), transparent),
                radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.05), transparent);
}

.desktop-header {
    width: 100%;
    max-width: 420px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
    font-family: var(--font-heading);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.logo-glow {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
}

.header-logo span {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.header-logo small {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 2px;
}

.desktop-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-secondary-desktop {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-quick);
}

.btn-secondary-desktop:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.live-clock {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: monospace;
}

/* --------------------------------------------------------------------------
   3. SMARTPHONE DEVICE FRAME MOCKUP
   -------------------------------------------------------------------------- */
.device-frame {
    width: 410px;
    height: 840px;
    border-radius: 48px;
    border: 12px solid #1e293b;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8),
                0 0 0 2px rgba(255, 255, 255, 0.05),
                0 0 30px rgba(6, 182, 212, 0.1);
    background: #090d16;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}

/* Active frame toggling (expands to standard desktop web app if toggled) */
.device-frame.expanded {
    width: 100%;
    max-width: 960px;
    height: 880px;
    border-radius: 16px;
    border-width: 4px;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-premium);
}

.device-notch {
    width: 140px;
    height: 28px;
    background: #1e293b;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    transition: var(--transition-smooth);
}

/* Hide notch in expanded layout */
.device-frame.expanded .device-notch {
    display: none;
}

.device-notch .camera {
    width: 10px;
    height: 10px;
    background: #0f172a;
    border-radius: 50%;
    box-shadow: inset 0 0 3px #111;
}

.device-notch .speaker {
    width: 45px;
    height: 4px;
    background: #334155;
    border-radius: 2px;
}

.device-home-bar {
    width: 130px;
    height: 5px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 3px;
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    transition: var(--transition-smooth);
}

.device-frame.expanded .device-home-bar {
    display: none;
}

.device-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border-radius: 36px;
}

.device-frame.expanded .device-screen {
    border-radius: 12px;
}

/* Internal phone status bar */
.phone-status-bar {
    height: 38px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 28px 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    z-index: 90;
    background: linear-gradient(to bottom, rgba(9, 13, 22, 0.8), transparent);
    transition: var(--transition-smooth);
}

.device-frame.expanded .phone-status-bar {
    display: none;
}

.status-icons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.battery-green {
    color: var(--success);
}

/* --------------------------------------------------------------------------
   4. GLASSMORPHISM & GENERAL UI ELEMENTS
   -------------------------------------------------------------------------- */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger {
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 12px 18px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: var(--transition-quick);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255,255,255,0.2);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #be123c);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.95;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--danger);
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: var(--transition-quick);
}

.btn-danger-outline:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-large {
    padding: 16px 24px;
    font-size: 1rem;
    border-radius: 14px;
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.78rem;
    border-radius: 8px;
}

.btn-glow {
    position: relative;
    box-shadow: 0 0 20px var(--primary-glow);
}

/* Icon Buttons */
.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition-quick);
}

.btn-icon:hover {
    color: var(--text-primary);
}

.btn-icon-circular {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-quick);
}

.btn-icon-circular:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Badges & Counters */
.badge {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-outline {
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
}

.badge-glow {
    background: rgba(6, 182, 212, 0.15);
    color: var(--primary);
    border: 1px solid rgba(6, 182, 212, 0.3);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.15);
}

.badge-count {
    background: var(--danger);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0 4px;
    margin-left: 4px;
}

/* Inputs and Forms styling */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    text-align: left;
    min-width: 0;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.92rem;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-quick);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
    background: rgba(15, 23, 42, 0.7);
}

.form-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* Custom select styling */
.custom-select-wrapper {
    position: relative;
    display: flex;
    width: 100%;
}

.custom-select-wrapper select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 36px !important;
}

.select-chevron {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Passcode input eye toggle */
.passcode-input-wrapper {
    position: relative;
    display: flex;
    width: 100%;
}

.passcode-input-wrapper input {
    width: 100%;
    padding-right: 44px !important;
}

.passcode-input-wrapper .btn-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   5. VIEW CONTROLS & ANIMATIONS
   -------------------------------------------------------------------------- */
.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #090d16;
    padding: 16px 20px 24px;
    position: relative;
}

/* Screen Transitions */
.app-screen {
    display: none;
    flex-direction: column;
    min-height: 100%;
    animation: fadeIn 0.4s ease-out;
}

.app-screen.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.hide {
    display: none !important;
}

/* --------------------------------------------------------------------------
   6. SCREEN 1: LOGIN STYLING
   -------------------------------------------------------------------------- */
.login-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 0 10px;
}

.brand-hero {
    text-align: center;
    margin-bottom: 28px;
    animation: slideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.icon-hexagon {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    margin: 0 auto 16px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.3),
                0 0 0 4px rgba(6, 182, 212, 0.1);
}

.brand-hero h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2.2rem;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-hero p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.login-card {
    border-radius: 24px;
    padding: 24px;
}

.login-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    margin-bottom: 16px;
}

.error-alert {
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.login-footer {
    text-align: center;
    margin-top: auto;
    padding-top: 24px;
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* --------------------------------------------------------------------------
   7. SCREEN 2: DASHBOARD STYLING
   -------------------------------------------------------------------------- */
.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-weight: 800;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(6, 182, 212, 0.2);
}

.user-details h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
}

.user-details p {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* KPI Dash Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.kpi-card {
    border-radius: 16px;
    padding: 14px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--card-color);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.kpi-icon {
    font-size: 0.85rem;
    color: var(--card-color);
    opacity: 0.8;
}

.kpi-value {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1.1;
    margin-bottom: 4px;
}

.kpi-subtext {
    font-size: 0.65rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-subtext i {
    color: var(--success);
}

.dashboard-actions {
    margin-bottom: 24px;
}

/* Tab controls layout */
.tab-navbar {
    display: flex;
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 4px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: var(--transition-quick);
}

.tab-btn i {
    font-size: 0.95rem;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.06);
    color: var(--primary);
}

.tab-content-wrapper {
    flex: 1;
}

.tab-pane {
    display: none;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

.tab-pane.active {
    display: flex;
}

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

.pane-header h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
}

/* Filter controls inside history */
.history-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

.filter-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.filter-col label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.filter-col select {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.78rem;
    padding: 6px 8px;
    color: var(--text-primary);
    outline: none;
}

/* History logs list view */
.history-list, .approvals-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.entry-item-card {
    border-radius: 14px;
    padding: 12px 14px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 3px solid;
    transition: var(--transition-quick);
}

.entry-item-card:hover {
    transform: translateX(2px);
    background: rgba(255,255,255,0.02);
}

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

.entry-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.entry-card-title h5 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.88rem;
}

.entry-card-date {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.entry-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 6px 10px;
    gap: 4px;
}

.stat-cell {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.stat-cell-lbl {
    font-size: 0.58rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-cell-val {
    font-size: 0.78rem;
    font-weight: 700;
}

.entry-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    color: var(--text-secondary);
    padding-top: 2px;
}

.badge-status {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-approved {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-pending {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.empty-state i {
    font-size: 2.2rem;
    opacity: 0.35;
}

.empty-state p {
    font-size: 0.85rem;
}

/* Approval entry item specifically */
.approval-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

/* --------------------------------------------------------------------------
   8. SCREEN 3: DATA ENTRY WIZARD STYLING
   -------------------------------------------------------------------------- */
.wizard-header {
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.btn-back {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-back:hover {
    color: var(--text-primary);
}

.wizard-title-area {
    text-align: center;
    line-height: 1.2;
}

.wizard-title-area h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
}

.wizard-title-area p {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.wizard-step-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* Top wizard progress bar */
.wizard-progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-bottom: 16px;
    overflow: hidden;
}

.wizard-progress-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main wizard Card */
.wizard-card {
    border-radius: 24px;
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 450px;
    position: relative;
    overflow-y: auto;
}

.wizard-step-pane {
    display: none;
    flex-direction: column;
    height: 100%;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.wizard-step-pane.active {
    display: flex;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(15px); }
    to { opacity: 1; transform: translateX(0); }
}

.step-icon-indicator {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(6, 182, 212, 0.08);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 14px;
}

.step-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    text-align: left;
    margin-bottom: 4px;
}

.step-instruction {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: left;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* ARC wizard panes and tables styling */
.arc-step-pane {
    display: none;
    flex-direction: column;
    width: 100%;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.arc-step-pane.active {
    display: flex;
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    table-layout: fixed;
}

.premium-table th {
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.6rem;
    letter-spacing: 0.3px;
    padding: 6px 2px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.premium-table td {
    padding: 4px 2px;
    vertical-align: middle;
}

.premium-table input,
.premium-table select {
    background: rgba(15, 23, 42, 0.4) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    padding: 6px 4px !important;
    font-size: 0.72rem !important;
    color: var(--text-primary) !important;
    outline: none;
    transition: var(--transition-quick);
    width: 100%;
    box-sizing: border-box;
}

.premium-table input:focus,
.premium-table select:focus {
    border-color: var(--primary) !important;
    background: rgba(15, 23, 42, 0.7) !important;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15) !important;
}

/* Step 1: Shift radio pill options grid */
.shift-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 4px;
}

.shift-pill-option {
    cursor: pointer;
}

.shift-pill-option input {
    display: none;
}

.shift-pill-option .pill-card {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
    padding: 10px 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: var(--transition-quick);
}

.shift-pill-option input:checked + .pill-card {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.1);
}

.pill-letter {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-secondary);
}

.shift-pill-option input:checked + .pill-card .pill-letter {
    color: var(--primary);
}

.pill-time {
    font-size: 0.58rem;
    color: var(--text-muted);
}

/* Steps 2-4: Keypad display inputs */
.numeric-numpad-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 10px;
}

.numpad-input-display {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 20px;
    position: relative;
}

.numpad-value-field {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2.2rem;
    color: var(--text-primary);
    text-align: left;
}

/* Remove up/down spinners on input number */
.numpad-value-field::-webkit-inner-spin-button, 
.numpad-value-field::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}

.numpad-unit {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-left: 10px;
}

.numpad-quick-suggestions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.btn-suggestion {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 4px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-quick);
}

.btn-suggestion:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

/* Step 5: Raw material selector custom grid */
.raw-material-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.material-units-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.material-unit-pill {
    cursor: pointer;
}

.material-unit-pill input {
    display: none;
}

.material-unit-pill span {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 10px 4px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: var(--transition-quick);
}

.material-unit-pill input:checked + span {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: #a7f3d0;
}

/* Step 6 & Settings: Custom field dynamically added items */
.dynamic-inputs-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Step 7: Summary card review sheet */
.summary-sheet {
    border-radius: 16px;
    padding: 16px;
    text-align: left;
    position: relative;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

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

.summary-header h4 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
}

.summary-meta-row {
    display: flex;
    gap: 14px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.summary-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 0 12px;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.summary-cell {
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cell-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.cell-val {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
}

.val-cyan { color: var(--primary); }
.val-blue { color: var(--secondary); }
.val-rose { color: var(--danger); }
.val-green { color: var(--success); }

.summary-dynamic-section {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-dynamic-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 12px;
    border-radius: 6px;
}

.summary-dynamic-row span:first-child {
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-dynamic-row span:last-child {
    font-weight: 700;
}

.signing-disclaimer {
    display: flex;
    gap: 8px;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 14px;
    line-height: 1.3;
}

.signing-disclaimer i {
    color: var(--warning);
}

/* Wizard Footer Navigation Actions */
.wizard-footer-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.wizard-footer-actions button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255,255,255,0.02);
    border-color: var(--border-color);
}

/* --------------------------------------------------------------------------
   9. SETTINGS & DYNAMIC FIELDS CONFIGURATION
   -------------------------------------------------------------------------- */
.settings-card {
    border-radius: 18px;
    padding: 16px;
    text-align: left;
}

.settings-card h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.settings-card-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.settings-divider {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 16px 0;
}

.settings-card h5 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.custom-fields-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.field-setting-info h6 {
    font-size: 0.78rem;
    font-weight: 700;
}

.field-setting-info p {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.btn-delete-field {
    color: var(--danger);
    cursor: pointer;
    font-size: 0.85rem;
    background: transparent;
    border: none;
    padding: 4px;
}

.btn-delete-field:hover {
    opacity: 0.8;
}

.maintenance-buttons {
    display: flex;
    gap: 10px;
}

.maintenance-buttons button {
    flex: 1;
    font-size: 0.78rem;
    padding: 10px 4px;
}

/* --------------------------------------------------------------------------
   10. TOAST NOTIFICATIONS & MODALS
   -------------------------------------------------------------------------- */
.toast-notification {
    position: absolute;
    top: 48px;
    left: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(6, 182, 212, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 200;
    font-size: 0.78rem;
    font-weight: 600;
    animation: slideDownToast 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.device-frame.expanded .toast-notification {
    top: 20px;
}

@keyframes slideDownToast {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast-icon {
    color: var(--primary);
    font-size: 1rem;
}

/* Modals */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 15, 25, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 150;
    padding: 20px;
}

.modal-card {
    width: 100%;
    max-width: 360px;
    border-radius: 20px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.anim-zoom {
    animation: zoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

.modal-header h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-body {
    text-align: left;
    margin-bottom: 16px;
    max-height: 480px;
    overflow-y: auto;
}

.modal-body .summary-sheet {
    border-color: var(--border-color);
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-actions button {
    flex: 1;
}

/* Helpers */
.text-teal { color: var(--primary) !important; }
.text-blue { color: var(--secondary) !important; }
.text-emerald { color: var(--success) !important; }
.text-rose { color: var(--danger) !important; }
.text-amber { color: var(--warning) !important; }

/* Compact Production Lab Table/Grid styling */
.prod-lab-table-container {
    width: 100%;
    margin-top: 10px;
    max-height: 480px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
}

.prod-lab-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.prod-lab-table th, .prod-lab-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

.prod-lab-table th {
    background: rgba(15, 23, 42, 0.9);
    font-weight: 700;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.prod-lab-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.prod-lab-machine-name {
    font-weight: 600;
    color: var(--text-primary);
}

.prod-lab-input-cell {
    width: 16%;
}

.prod-lab-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid var(--border-color) !important;
    padding: 6px 8px !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    color: var(--text-primary) !important;
    outline: none !important;
    text-align: center;
    transition: var(--transition-quick);
}

.prod-lab-input:focus {
    border-color: var(--primary) !important;
    background: rgba(15, 23, 42, 0.9) !important;
    box-shadow: 0 0 5px rgba(6, 182, 212, 0.3);
}

.prod-lab-input::-webkit-inner-spin-button, 
.prod-lab-input::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}

/* --------------------------------------------------------------------------
   11. MEDIA QUERIES (RESPONSIVENESS & ADAPTIVITY)
   -------------------------------------------------------------------------- */
/* When viewport width is less than 768px (real mobile/tablet device), 
   collapse the device frame borders to occupy the full native display */
@media (max-width: 767px) {
    body {
        background-color: #090d16;
        align-items: stretch;
    }
    
    .app-viewport-wrapper {
        padding: 0;
        background: none;
        min-height: 100vh;
        justify-content: stretch;
    }
    
    .desktop-header {
        display: none; /* Hide top frame control panel on mobile */
    }
    
    .device-frame {
        width: 100% !important;
        height: 100vh !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    
    .device-screen {
        border-radius: 0 !important;
    }
    
    .device-notch {
        display: none;
    }
    
    .device-home-bar {
        display: none;
    }
    
    .phone-status-bar {
        display: none;
    }
    
    .app-container {
        padding: 12px 14px 18px; /* Slightly tighter paddings for phone */
    }
}

/* --------------------------------------------------------------------------
   12. SPECIALIZED A4 REPORT PRINT STYLES
   -------------------------------------------------------------------------- */
@media print {
    /* Hide everything on screen except the high-contrast reports */
    body, html {
        background: #fff !important;
        color: #000 !important;
        font-family: Arial, sans-serif !important;
        width: 210mm;
        height: 297mm;
        margin: 0 !important;
        padding: 10mm !important;
    }
    
    .app-viewport-wrapper, 
    .desktop-header, 
    .device-frame, 
    .device-screen, 
    .phone-status-bar, 
    .device-notch, 
    .device-home-bar,
    .screen-header,
    .dashboard-actions,
    .tab-navbar,
    .pane-filters,
    .history-filters,
    .wizard-header,
    .wizard-progress-bar-container,
    .wizard-footer-actions,
    .toast-notification,
    .modal-overlay,
    #screen-login,
    #screen-wizard,
    #tab-settings,
    #tab-approvals {
        display: none !important;
    }
    
    /* Reveal printed history pane */
    #screen-dashboard {
        display: block !important;
        width: 100% !important;
    }
    
    #tab-history {
        display: block !important;
        width: 100% !important;
    }
    
    /* Layout table styling specifically for paper reports */
    .history-list {
        display: table !important;
        width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 20px !important;
    }
    
    .entry-item-card {
        display: table-row !important;
        border: 1px solid #000 !important;
        background: none !important;
    }
    
    /* Custom CSS table generation for standard print formatting */
    .entry-card-header, .entry-card-footer {
        display: none !important; /* Hide details irrelevant to printer layout */
    }
    
    .entry-stats-row {
        display: table-row !important;
        background: none !important;
        padding: 0 !important;
    }
    
    .stat-cell {
        display: table-cell !important;
        border: 1px solid #ccc !important;
        padding: 6px 10px !important;
        text-align: center !important;
    }
    
    .stat-cell-lbl {
        font-weight: bold !important;
        color: #000 !important;
        font-size: 8px !important;
    }
    
    .stat-cell-val {
        font-size: 10px !important;
    }
}
