/* CherryMax Rework Agent — Global Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f0f4f8;
    color: #1e293b;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* Login */
.login-screen {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: linear-gradient(135deg, #0f1a2e, #1a2744);
}
.login-card {
    background: white; border-radius: 16px; padding: 2.5rem; width: 380px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-brand .brand-icon {
    width: 56px; height: 56px; margin: 0 auto 1rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8); border-radius: 14px;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
    color: white; box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}
.login-brand h1 { font-size: 1.5rem; font-weight: 800; color: #0f172a; }
.login-brand p { font-size: 0.85rem; color: #64748b; }

/* App Shell */
.app-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 220px; background: linear-gradient(180deg, #0f1a2e, #1a2744);
    color: white; display: flex; flex-direction: column; position: fixed;
    top: 0; left: 0; bottom: 0; z-index: 100; box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}
.sidebar-brand {
    padding: 1.5rem 1.25rem; display: flex; align-items: center; gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .brand-icon {
    width: 36px; height: 36px; background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.sidebar-brand .brand-text { display: flex; flex-direction: column; }
.sidebar-brand .brand-name { font-weight: 700; font-size: 1rem; }
.sidebar-brand .brand-subtitle { font-size: 0.7rem; opacity: 0.6; }
.sidebar-nav { flex: 1; padding: 1.25rem 0.75rem; display: flex; flex-direction: column; gap: 0.2rem; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.85rem;
    color: rgba(255,255,255,0.6); text-decoration: none; border-radius: 8px;
    font-size: 0.85rem; font-weight: 500; transition: all 0.2s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9); }
.sidebar-nav a.active { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: white; box-shadow: 0 4px 12px rgba(37,99,235,0.3); font-weight: 600; }
.sidebar-nav .nav-icon { width: 20px; text-align: center; font-size: 1rem; }
.sidebar-footer { padding: 1.25rem; border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.75rem; }
.sidebar-footer .status-dot { display: inline-block; width: 8px; height: 8px; background: #22c55e; border-radius: 50%; margin-right: 0.5rem; }
.sidebar-footer .status-text { opacity: 0.7; }
.sidebar-footer .version { opacity: 0.4; margin-top: 0.3rem; }

/* Main */
.main-wrapper { margin-left: 220px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.top-header {
    background: white; border-bottom: 1px solid #e2e8f0; padding: 1rem 2rem;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.top-header .page-title-area { display: flex; align-items: center; gap: 0.75rem; }
.top-header .page-icon { font-size: 1.25rem; }
.top-header .page-title { font-size: 1.25rem; font-weight: 700; color: #0f172a; }
.top-header .page-subtitle { font-size: 0.8rem; color: #64748b; }
.top-header .user-area { display: flex; align-items: center; gap: 1.25rem; }
.top-header .user-avatar {
    width: 36px; height: 36px; background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700;
}
.top-header .user-name { font-size: 0.85rem; font-weight: 600; color: #0f172a; }
.top-header .user-role { font-size: 0.72rem; color: #64748b; }
.page-content { flex: 1; padding: 2rem; }

/* Flash */
.flash-messages { padding: 0 2rem; margin-top: 0.75rem; }
.flash-msg { padding: 0.85rem 1.25rem; border-radius: 8px; margin-bottom: 0.5rem; font-size: 0.85rem; font-weight: 500; }
.flash-msg.info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.flash-msg.error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.flash-msg.success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* Buttons */
.btn { padding: 0.55rem 1.1rem; border-radius: 8px; font-size: 0.82rem; font-weight: 600; cursor: pointer; border: none; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; transition: all 0.2s; }
.btn-primary { background: linear-gradient(135deg, #1a2332, #2d3748); color: white; box-shadow: 0 2px 8px rgba(26,35,50,0.2); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,35,50,0.3); }
.btn-blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: white; }
.btn-blue:hover { transform: translateY(-1px); }
.btn-outline { background: white; color: #374151; border: 1px solid #d1d5db; }
.btn-outline:hover { background: #f9fafb; }

/* Form */
.form-group { margin-bottom: 0.75rem; }
label { display: block; margin-bottom: 0.2rem; font-weight: 500; color: #374151; font-size: 0.8rem; }
select, input[type="text"], input[type="number"], input[type="email"], input[type="password"] {
    width: 100%; padding: 0.5rem 0.6rem; border: 1px solid #e2e8f0; border-radius: 6px;
    font-size: 0.85rem; background: white; color: #1a202c;
}
select:focus, input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }

/* Status cards */
.status-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-bottom: 1.75rem; }
.status-card {
    background: white; border-radius: 14px; padding: 1.25rem 1.5rem;
    display: flex; align-items: center; gap: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.04);
    cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.status-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.status-card .card-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.status-card .card-icon.active { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #2563eb; }
.status-card .card-icon.paused { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #d97706; }
.status-card .card-icon.completed { background: linear-gradient(135deg, #f0fdf4, #dcfce7); color: #16a34a; }
.status-card .card-icon.hold { background: linear-gradient(135deg, #f5f3ff, #ede9fe); color: #7c3aed; }
.status-card .card-title { font-size: 0.72rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.status-card .card-value { font-size: 2rem; font-weight: 800; line-height: 1.2; }
.status-card .card-value.active { color: #2563eb; }
.status-card .card-value.paused { color: #d97706; }
.status-card .card-value.completed { color: #16a34a; }
.status-card .card-value.hold { color: #7c3aed; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.search-box { display: flex; align-items: center; background: white; border: 1px solid #e2e8f0; border-radius: 10px; padding: 0.6rem 1rem; gap: 0.6rem; flex: 1; max-width: 380px; }
.search-box:focus-within { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.search-box input { border: none; outline: none; font-size: 0.85rem; flex: 1; color: #1e293b; }
.search-box input::placeholder { color: #94a3b8; }

/* Table */
.table-container { background: white; border-radius: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); overflow: hidden; border: 1px solid rgba(0,0,0,0.04); }
.jobs-table { width: 100%; border-collapse: collapse; }
.jobs-table th { text-align: left; padding: 0.9rem 1.25rem; font-size: 0.72rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid #f1f5f9; background: #fafbfd; }
.jobs-table td { padding: 1rem 1.25rem; font-size: 0.85rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.jobs-table tr:hover { background: #f8fafc; }
.jobs-table .lot-number { font-weight: 700; color: #0f172a; font-size: 0.9rem; }
.table-footer { padding: 0.9rem 1.25rem; font-size: 0.8rem; color: #64748b; border-top: 1px solid #f1f5f9; }

/* Status badge */
.status-badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; text-transform: capitalize; }
.status-badge.active { background: #eff6ff; color: #2563eb; }
.status-badge.paused { background: #fef3c7; color: #d97706; }
.status-badge.completed { background: #f0fdf4; color: #16a34a; }
.status-badge.hold { background: #f5f3ff; color: #7c3aed; }
.status-badge .badge-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-badge.active .badge-dot { background: #2563eb; }
.status-badge.paused .badge-dot { background: #f59e0b; }
.status-badge.completed .badge-dot { background: #22c55e; }
.status-badge.hold .badge-dot { background: #8b5cf6; }

/* Progress bar */
.progress-bar-container { display: flex; align-items: center; gap: 0.5rem; }
.progress-bar { flex: 1; height: 7px; background: #e2e8f0; border-radius: 4px; overflow: hidden; max-width: 90px; }
.progress-bar .fill { height: 100%; border-radius: 4px; }
.progress-bar .fill.green { background: linear-gradient(90deg, #22c55e, #16a34a); }
.progress-bar .fill.orange { background: linear-gradient(90deg, #f59e0b, #d97706); }
.progress-bar .fill.blue { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.progress-pct { font-size: 0.75rem; color: #64748b; font-weight: 600; }

/* Action buttons */
.action-btn { padding: 0.4rem 0.8rem; border-radius: 6px; font-size: 0.75rem; font-weight: 600; cursor: pointer; border: 1px solid #e2e8f0; background: white; color: #374151; display: inline-flex; align-items: center; gap: 0.3rem; transition: all 0.15s; }
.action-btn:hover { background: #f1f5f9; }
.action-btn.primary { background: linear-gradient(135deg, #1a2332, #2d3748); color: white; border-color: transparent; }

/* Empty state */
.empty-state { text-align: center; padding: 4rem 2rem; color: #64748b; }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.6; }
.empty-state p { margin-bottom: 1.25rem; font-size: 0.9rem; }
