/* SERVO v26001 - Electron Plus Manufacturing System */

:root {
    --bg-dark: #1a1a2e;
    --bg-sidebar: #16213e;
    --bg-content: #f0f2f5;
    --bg-card: #ffffff;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #e2e8f0;
    --border: #e2e8f0;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    min-height: 100vh;
    background: var(--bg-content);
    color: var(--text-primary);
}

/* Sidebar */
.sidebar {
    width: 180px;
    background: var(--bg-sidebar);
    color: var(--text-light);
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.sidebar-header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
}

.version {
    font-size: 11px;
    opacity: 0.5;
}

.nav-links {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}

.nav-links li a {
    display: block;
    padding: 7px 16px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}

.nav-links li a:hover {
    background: rgba(255,255,255,0.05);
}

.nav-links li a.active {
    background: rgba(14, 165, 233, 0.15);
    border-left-color: var(--accent);
    color: var(--accent);
}

/* Main content */
.content {
    margin-left: 180px;
    flex: 1;
    min-height: 100vh;
}

.top-bar {
    background: var(--bg-card);
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar h2 {
    font-size: 20px;
    font-weight: 600;
}

.page-content {
    padding: 24px 32px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Grid */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}

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

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover { background: #16a34a; }

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

.btn-secondary {
    background: var(--bg-content);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover td {
    background: rgba(14, 165, 233, 0.03);
}

/* Flash messages */
.flash {
    padding: 12px 20px;
    margin: 16px 32px;
    border-radius: var(--radius);
    font-size: 14px;
}
.flash.success { background: #dcfce7; color: #166534; }
.flash.error { background: #fef2f2; color: #991b1b; }
.flash.warning { background: #fefce8; color: #854d0e; }

/* Label preview */
.label-preview {
    background: white;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 20px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.label-preview pre {
    font-family: "Courier New", monospace;
    font-size: 11px;
    white-space: pre-wrap;
    max-width: 100%;
    overflow-x: auto;
}

/* Contents editor */
.contents-list {
    list-style: none;
}

.contents-list li {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.contents-list input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
}

.contents-list .qty { width: 50px; }
.contents-list .code { width: 120px; }
.contents-list .desc { flex: 1; }

.btn-remove {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

/* Stat cards */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Print controls */
.print-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px;
    background: var(--bg-content);
    border-radius: var(--radius);
    margin-top: 16px;
}

.print-controls label {
    font-size: 14px;
    font-weight: 500;
}

.print-controls input[type="number"] {
    width: 80px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* Printer status */
.printer-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--error); }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 50px; }
    .sidebar-header h1 { display: none; }
    .version { display: none; }
    .nav-links li a { padding: 8px; text-align: center; font-size: 0; }
    .content { margin-left: 50px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
