:root {
    --purple: #6a1b9a;
    --purple-dark: #4a148c;
    --purple-light: #9c4dcc;
    --gold: #f9a825;
    --gold-light: #ffd54f;
    --sidebar-width: 240px;
    --topbar-height: 60px;
}
* { box-sizing: border-box; }
body {
    font-family: 'Segoe UI', sans-serif;
    background: #f5f5f5;
    margin: 0;
    font-size: 14px;
}
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: var(--purple);
    display: flex;
    align-items: center;
    z-index: 1000;
    padding: 0 16px;
    gap: 12px;
}
.topbar .brand {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    white-space: nowrap;
}
.topbar .shop-name {
    background: var(--purple-dark);
    color: #fff;
    padding: 6px 18px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    margin: 0 auto;
}
.topbar .wa-status { font-size: 12px; font-weight: 600; white-space: nowrap; }
.topbar .wa-status.connected { color: #69f0ae; }
.topbar .wa-status.disconnected { color: #ff5252; }
.topbar .topbar-user { color: #fff; font-size: 13px; white-space: nowrap; }
.topbar .btn-logout {
    background: rgba(255,255,255,0.15);
    border: none; color: #fff;
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
}
.topbar .btn-logout:hover { background: rgba(255,255,255,0.25); }
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--topbar-height));
    background: #fff;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    z-index: 999;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #ddd; }
.sidebar-section { padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.sidebar-label {
    font-size: 10px; font-weight: 700; color: #aaa;
    padding: 4px 16px; text-transform: uppercase; letter-spacing: 1px;
}
.sidebar a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; color: #555; text-decoration: none;
    font-size: 13.5px; font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.sidebar a:hover { background: #f3e5f5; color: var(--purple); border-left-color: var(--purple-light); }
.sidebar a.active { background: #f3e5f5; color: var(--purple); border-left-color: var(--purple); font-weight: 600; }
.sidebar a i { font-size: 16px; width: 20px; text-align: center; color: var(--purple-light); }
.sidebar a.active i { color: var(--purple); }
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 24px;
    min-height: calc(100vh - var(--topbar-height));
}
.page-header {
    display: flex; align-items: center;
    justify-content: space-between; margin-bottom: 20px;
}
.page-title { font-size: 20px; font-weight: 700; color: #333; margin: 0; }
.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.status-card {
    border-radius: 10px; padding: 18px 16px;
    text-align: center; cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    text-decoration: none; display: block;
}
.status-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.15); text-decoration: none; }
.status-card .count { font-size: 32px; font-weight: 800; color: #fff; line-height: 1; }
.status-card .label { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.9); text-transform: uppercase; margin-top: 6px; }
.card-all       { background: linear-gradient(135deg, #26c6da, #00838f); }
.card-reception { background: linear-gradient(135deg, #ffa726, #e65100); }
.card-service   { background: linear-gradient(135deg, #ab47bc, #6a1b9a); }
.card-onsite    { background: linear-gradient(135deg, #ef5350, #b71c1c); }
.card-ready     { background: linear-gradient(135deg, #26a69a, #00695c); }
.card-test      { background: linear-gradient(135deg, #42a5f5, #1565c0); }
.card-delivered { background: linear-gradient(135deg, #ec407a, #880e4f); }
.table-card { background: #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.07); overflow: hidden; }
.table-card .table thead th {
    background: var(--gold); color: #333;
    font-weight: 700; font-size: 12.5px;
    border: none; padding: 12px 14px; white-space: nowrap;
}
.table-card .table tbody td { padding: 11px 14px; vertical-align: middle; border-color: #f5f5f5; font-size: 13px; }
.table-card .table tbody tr:hover { background: #fafafa; }
.badge-status { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-open             { background: #e3f2fd; color: #1565c0; }
.badge-reception        { background: #fff3e0; color: #e65100; }
.badge-service_center   { background: #f3e5f5; color: #6a1b9a; }
.badge-on_site          { background: #fce4ec; color: #880e4f; }
.badge-ready_to_deliver { background: #e8f5e9; color: #2e7d32; }
.badge-test             { background: #e3f2fd; color: #1565c0; }
.badge-delivered        { background: #ede7f6; color: #4a148c; }
.badge-cancelled        { background: #ffebee; color: #c62828; }
.badge-high   { background: #ffebee; color: #c62828; }
.badge-medium { background: #fff8e1; color: #f57f17; }
.badge-low    { background: #e8f5e9; color: #2e7d32; }
.form-card { background: #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.07); padding: 24px; }
.form-section-title {
    font-size: 13px; font-weight: 700; color: var(--purple);
    text-transform: uppercase; letter-spacing: 0.5px;
    padding-bottom: 8px; border-bottom: 2px solid var(--purple-light);
    margin-bottom: 16px; margin-top: 8px;
}
.form-label { font-size: 12px; font-weight: 600; color: #666; margin-bottom: 4px; }
.form-control, .form-select { font-size: 13px; border-color: #ddd; border-radius: 6px; padding: 8px 12px; }
.form-control:focus, .form-select:focus { border-color: var(--purple-light); box-shadow: 0 0 0 3px rgba(106,27,154,0.1); }
.btn-purple { background: var(--purple); color: #fff; border: none; border-radius: 6px; padding: 8px 20px; font-weight: 600; font-size: 13px; }
.btn-purple:hover { background: var(--purple-dark); color: #fff; }
.btn-gold { background: var(--gold); color: #333; border: none; border-radius: 6px; padding: 8px 20px; font-weight: 600; font-size: 13px; }
.btn-gold:hover { background: var(--gold-light); color: #333; }
.sr-badge { background: #f5f5f5; border: 1px solid #ddd; border-radius: 20px; padding: 3px 10px; font-size: 12px; font-weight: 600; color: #555; }
.alert { border-radius: 8px; font-size: 13px; }
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple) 50%, var(--purple-light) 100%);
    display: flex; align-items: center; justify-content: center;
}
.login-card {
    background: #fff; border-radius: 16px; padding: 40px;
    width: 100%; max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-size: 22px; font-weight: 800; color: var(--purple); margin: 0; letter-spacing: 1px; }
.login-logo p { color: #888; font-size: 13px; margin: 4px 0 0; }
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 16px; }
    .status-cards { grid-template-columns: repeat(3, 1fr); }
}
