/* ============================================
   TEMA PRETO & AMARELO - OFICINA MECÂNICA
   ============================================ */

:root {
    --black: #0a0a0a;
    --black-light: #1a1a1a;
    --black-medium: #2a2a2a;
    --black-border: #333;
    --yellow: #f5c518;
    --yellow-dark: #d4a800;
    --yellow-light: #ffe066;
    --yellow-bg: rgba(245, 197, 24, 0.08);
    --white: #f0f0f0;
    --white-soft: #ccc;
    --gray: #888;
    --gray-dark: #555;
    --red: #e74c3c;
    --green: #27ae60;
    --blue: #3498db;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
    --transition: 0.2s ease;
}

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

body {
    font-family: var(--font);
    background: var(--black);
    color: var(--white);
    min-height: 100vh;
}

a { color: var(--yellow); text-decoration: none; }
a:hover { color: var(--yellow-light); }

/* === LOGIN PAGE === */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: linear-gradient(135deg, var(--black) 0%, #1a1a0a 100%);
}
.login-card {
    background: var(--black-light);
    border: 1px solid var(--black-border);
    border-radius: 12px; padding: 40px; width: 400px; max-width: 90%;
    box-shadow: 0 8px 32px rgba(245,197,24,0.08);
}
.login-logo {
    text-align: center; margin-bottom: 30px;
    font-size: 48px;
}
.login-card h1 {
    text-align: center; color: var(--yellow); margin-bottom: 8px; font-size: 22px;
}
.login-card p {
    text-align: center; color: var(--gray); margin-bottom: 30px; font-size: 14px;
}

/* === FORMS === */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; margin-bottom: 6px; color: var(--white-soft);
    font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.form-control {
    width: 100%; padding: 10px 14px;
    background: var(--black-medium); border: 1px solid var(--black-border);
    border-radius: var(--radius); color: var(--white); font-size: 14px;
    font-family: var(--font); transition: var(--transition);
}
.form-control:focus {
    outline: none; border-color: var(--yellow);
    box-shadow: 0 0 0 3px var(--yellow-bg);
}
.form-control::placeholder { color: var(--gray-dark); }
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control {
    appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    padding-right: 32px;
}

.form-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input[type="checkbox"] {
    width: 16px; height: 16px; accent-color: var(--yellow);
}

/* === BUTTONS === */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border: none; border-radius: var(--radius);
    font-size: 14px; font-weight: 600; font-family: var(--font);
    cursor: pointer; transition: var(--transition); text-decoration: none;
}
.btn-primary {
    background: var(--yellow); color: var(--black);
}
.btn-primary:hover { background: var(--yellow-dark); color: var(--black); }
.btn-secondary { background: var(--black-medium); color: var(--white); border: 1px solid var(--black-border); }
.btn-secondary:hover { background: var(--black-border); }
.btn-outline {
    background: transparent; color: var(--yellow); border: 1px solid var(--yellow);
}
.btn-outline:hover { background: var(--yellow); color: var(--black); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #219a52; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 8px; border-radius: 50%; width: 36px; height: 36px; justify-content: center; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* === APP LAYOUT === */
.app-layout { display: flex; min-height: 100vh; }

/* === SIDEBAR === */
.sidebar {
    width: 240px; min-width: 240px;
    background: var(--black-light); border-right: 1px solid var(--black-border);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
    overflow-y: auto;
}
.sidebar-brand {
    padding: 20px; border-bottom: 1px solid var(--black-border);
    display: flex; align-items: center; gap: 12px;
}
.brand-logo { width: 100px; height: 40px; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--black-medium); }
.sidebar-logo-img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-logo-placeholder { font-size: 24px; }
.brand-name { color: var(--yellow); font-weight: 700; font-size: 14px; line-height: 1.3; }
.sidebar-nav { padding: 12px; flex: 1; }
.nav-section {
    color: var(--gray); font-size: 10px; text-transform: uppercase;
    letter-spacing: 1px; padding: 16px 8px 6px; font-weight: 700;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius);
    color: var(--white-soft); font-size: 14px; text-decoration: none;
    transition: var(--transition); margin-bottom: 2px;
}
.nav-item:hover { background: var(--black-medium); color: var(--white); }
.nav-item.active { background: var(--yellow-bg); color: var(--yellow); font-weight: 600; }
.nav-icon { font-size: 16px; width: 24px; text-align: center; }

/* === TOPBAR === */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px; background: var(--black-light);
    border-bottom: 1px solid var(--black-border);
    position: sticky; top: 0; z-index: 10;
}
.page-title { font-size: 20px; color: var(--yellow); font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.user-info { display: flex; flex-direction: column; font-size: 13px; text-align: right; }
.user-info small { color: var(--gray); font-size: 11px; text-transform: capitalize; }

/* === CONTENT === */
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content-area { padding: 24px; flex: 1; }

/* === CARDS === */
.card {
    background: var(--black-light); border: 1px solid var(--black-border);
    border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 1px solid var(--black-border);
}
.card-title { font-size: 16px; font-weight: 700; color: var(--yellow); }
.card-body { }
.card-footer { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--black-border); }

/* === STATS CARDS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.stat-card {
    background: var(--black-light); border: 1px solid var(--black-border);
    border-radius: var(--radius); padding: 20px;
    display: flex; align-items: center; gap: 14px;
}
.stat-icon { font-size: 32px; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--yellow); }
.stat-label { font-size: 12px; color: var(--gray); margin-top: 2px; }

/* === TABLES === */
.table-container { overflow-x: auto; }
table {
    width: 100%; border-collapse: collapse;
}
table th, table td {
    padding: 10px 14px; text-align: left; font-size: 13px;
    border-bottom: 1px solid var(--black-border);
}
table th {
    background: var(--black-medium); color: var(--yellow);
    font-weight: 600; text-transform: uppercase; font-size: 11px;
    letter-spacing: 0.5px;
}
table tr:hover { background: var(--yellow-bg); }
table td { color: var(--white-soft); }

/* === STATUS BADGES === */
.status-badge {
    display: inline-block; padding: 4px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.3px;
}
.status-pending { background: rgba(52,152,219,0.15); color: var(--blue); }
.status-progress { background: rgba(245,197,24,0.15); color: var(--yellow); }
.status-warning { background: rgba(230,126,34,0.15); color: #e67e22; }
.status-done { background: rgba(39,174,96,0.15); color: var(--green); }
.status-delivered { background: rgba(39,174,96,0.25); color: #2ecc71; }
.status-cancelled { background: rgba(231,76,60,0.15); color: var(--red); }

/* === ALERTS === */
.alert {
    padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px;
    font-size: 14px; border-left: 4px solid;
}
.alert-success { background: rgba(39,174,96,0.1); border-color: var(--green); color: var(--green); }
.alert-error { background: rgba(231,76,60,0.1); border-color: var(--red); color: var(--red); }
.alert-warning { background: rgba(245,197,24,0.1); border-color: var(--yellow); color: var(--yellow); }
.alert-info { background: rgba(52,152,219,0.1); border-color: var(--blue); color: var(--blue); }

/* === MODAL === */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7); z-index: 100;
    align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--black-light); border: 1px solid var(--black-border);
    border-radius: 12px; padding: 24px; width: 500px; max-width: 90%;
    max-height: 80vh; overflow-y: auto;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.modal-title { color: var(--yellow); font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--gray); font-size: 24px; cursor: pointer; }

/* === TABS === */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--black-border); margin-bottom: 20px; }
.tab-btn {
    padding: 10px 20px; background: none; border: none; color: var(--gray);
    font-size: 14px; cursor: pointer; transition: var(--transition);
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    font-family: var(--font);
}
.tab-btn.active { color: var(--yellow); border-bottom-color: var(--yellow); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === SEARCH BAR === */
.search-bar {
    display: flex; gap: 8px; margin-bottom: 20px;
}
.search-bar .form-control { max-width: 300px; }

/* === IMAGE UPLOAD === */
.image-upload {
    width: 150px; height: 150px; border: 2px dashed var(--black-border);
    border-radius: var(--radius); display: flex; align-items: center;
    justify-content: center; cursor: pointer; overflow: hidden;
    position: relative; transition: var(--transition);
}
.image-upload:hover { border-color: var(--yellow); }
.image-upload img { max-width: 100%; max-height: 100%; object-fit: contain; }
.image-upload .placeholder { color: var(--gray); font-size: 13px; text-align: center; }
.image-upload input[type="file"] { display: none; }

/* === UTILITIES === */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-yellow { color: var(--yellow); }
.text-muted { color: var(--gray); font-size: 12px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mr-1 { margin-right: 8px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.hidden { display: none; }

/* === VOICE INPUT === */
.voice-btn {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--black-border);
    background: var(--black-medium); color: var(--gray); font-size: 18px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: var(--transition); z-index: 2;
}
.voice-btn:hover { border-color: var(--yellow); color: var(--yellow); }
.voice-btn.listening {
    border-color: var(--red); color: var(--red);
    animation: pulse-voice 1.2s infinite;
    box-shadow: 0 0 12px rgba(231,76,60,0.4);
}
@keyframes pulse-voice {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.15); }
}
.voice-wrapper { position: relative; }
.voice-wrapper .form-control { padding-right: 48px; }
.voice-hint {
    display: none; position: absolute; top: -32px; right: 0;
    background: var(--black-medium); color: var(--yellow);
    padding: 4px 10px; border-radius: 4px; font-size: 11px;
    white-space: nowrap; z-index: 3;
}
.voice-btn.listening + .voice-hint { display: block; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .sidebar { width: 60px; min-width: 60px; }
    .sidebar .brand-name, .sidebar .nav-item span:not(.nav-icon),
    .sidebar .nav-section { display: none; }
    .sidebar .nav-item { justify-content: center; padding: 12px; }
    .sidebar-brand { justify-content: center; padding: 12px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}

@media print {
    .sidebar, .topbar, .btn, form { display: none !important; }
    .main-content { margin: 0; }
    .content-area { padding: 0; }
    body { background: #fff; color: #000; }
    .card { border: 1px solid #ccc; }
}

/* === CARROSSEL PREVIEW === */
.carrossel-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.carrossel-item {
    position: relative; background: var(--black-medium);
    border-radius: var(--radius); overflow: hidden;
    aspect-ratio: 16/9;
}
.carrossel-item img { width: 100%; height: 100%; object-fit: cover; }
.carrossel-item .carrossel-actions {
    position: absolute; top: 8px; right: 8px; display: flex; gap: 4px;
}
.carrossel-item .carrossel-title {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 8px; background: linear-gradient(transparent, rgba(0,0,0,0.8));
    font-size: 13px; font-weight: 600;
}

/* === OS DETAIL === */
.os-header {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 20px; margin-bottom: 20px;
}
.os-info-group { }
.os-info-group dt { color: var(--gray); font-size: 12px; text-transform: uppercase; margin-bottom: 2px; }
.os-info-group dd { color: var(--white); font-size: 15px; margin-bottom: 12px; }

.os-timeline { margin: 20px 0; }
.timeline-item {
    display: flex; gap: 12px; padding: 10px 0; border-left: 2px solid var(--black-border);
    padding-left: 16px; margin-left: 8px; position: relative;
}
.timeline-item::before {
    content: ''; position: absolute; left: -6px; top: 14px;
    width: 10px; height: 10px; border-radius: 50%; background: var(--yellow);
}
.timeline-date { color: var(--gray); font-size: 11px; min-width: 60px; }
.timeline-status { font-weight: 600; font-size: 13px; }
.timeline-obs { color: var(--gray); font-size: 12px; margin-top: 2px; }

/* === PRINT PDF === */
.print-only { display: none; }
@media print {
    .print-only { display: block; }
    .no-print { display: none !important; }
}
