:root {
    --sidebar-width: 250px;
    --navbar-height: 56px;
    --color-primary: #1a3c5e;
    --color-secondary: #2980b9;
    --color-accent: #e67e22;
    --color-success: #27ae60;
    --color-danger: #c0392b;
    --color-sidebar-bg: #1a2f45;
    --color-sidebar-hover: #243d56;
}

body {
    background-color: #f0f4f8;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
}

/* Navbar */
.navbar-opme {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    height: var(--navbar-height);
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Sidebar */
#wrapper {
    height: calc(100vh - var(--navbar-height));
    overflow: hidden;
}

.sidebar-wrapper {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--color-sidebar-bg);
    height: 100%;
    overflow-y: auto;
    transition: width 0.3s ease, min-width 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
}

.sidebar-wrapper.collapsed {
    width: 0;
    min-width: 0;
    overflow: hidden;
}

.sidebar-wrapper .nav-link {
    color: #adb5bd;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-bottom: 2px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.sidebar-wrapper .nav-link:hover {
    background: var(--color-sidebar-hover);
    color: #fff;
}

.sidebar-wrapper .nav-link.active {
    background: var(--color-secondary);
    color: #fff;
    font-weight: 600;
}

.nav-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #546e7a;
    padding: 0.75rem 1rem 0.25rem;
    font-weight: 700;
}

.sidebar-header {
    background: rgba(0,0,0,0.2);
}

.sidebar-footer {
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Page Content */
#page-content-wrapper {
    height: 100%;
    overflow-y: auto;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

/* Dashboard stats cards */
.stat-card {
    border-radius: 12px;
    padding: 1.25rem;
    color: white;
    transition: transform 0.2s;
}
.stat-card:hover {
    transform: translateY(-3px);
}
.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.7;
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
}
.stat-card .stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

.stat-blue   { background: linear-gradient(135deg, #1a3c5e, #2980b9); }
.stat-green  { background: linear-gradient(135deg, #1e6b3a, #27ae60); }
.stat-orange { background: linear-gradient(135deg, #b7410e, #e67e22); }
.stat-purple { background: linear-gradient(135deg, #4a235a, #8e44ad); }
.stat-red    { background: linear-gradient(135deg, #7b241c, #c0392b); }
.stat-teal   { background: linear-gradient(135deg, #0e6655, #1abc9c); }

/* Badges */
.badge-nivel-administrador { background: #8e44ad !important; }
.badge-nivel-almoxarifado  { background: #2980b9 !important; }
.badge-nivel-enfermagem    { background: #27ae60 !important; }

/* Status badges */
.badge-status-pendente     { background: #f39c12; color: #fff; }
.badge-status-atendida     { background: #27ae60; color: #fff; }
.badge-status-parcial      { background: #3498db; color: #fff; }
.badge-status-cancelada    { background: #e74c3c; color: #fff; }
.badge-status-agendada     { background: #3498db; color: #fff; }
.badge-status-em_andamento { background: #f39c12; color: #fff; }
.badge-status-realizada    { background: #27ae60; color: #fff; }
.badge-status-aberta       { background: #3498db; color: #fff; }
.badge-status-finalizada   { background: #27ae60; color: #fff; }
.badge-status-impressa     { background: #6c757d; color: #fff; }

/* Tables */
.table-hover tbody tr:hover {
    background-color: rgba(41, 128, 185, 0.05);
}

.table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #546e7a;
    border-bottom: 2px solid #dee2e6;
    font-weight: 700;
}

/* Page header */
.page-header {
    background: white;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-header h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
}

.page-header .breadcrumb {
    margin: 0;
    font-size: 0.78rem;
}

/* Stock alert */
.stock-low {
    color: #e74c3c;
    font-weight: 600;
}
.stock-ok {
    color: #27ae60;
}

/* Buttons */
.btn-primary {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
}
.btn-primary:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

/* Login page */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-primary), #2c3e50);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

/* Print styles */
@media print {
    .navbar-opme, #sidebar, .sidebar-wrapper, .no-print, .btn {
        display: none !important;
    }
    #wrapper {
        display: block !important;
        height: auto !important;
    }
    #page-content-wrapper {
        height: auto !important;
        overflow: visible !important;
    }
    .print-ficha {
        width: 100%;
        max-width: 210mm;
        margin: 0 auto;
    }
    body { background: white !important; }
    .card { box-shadow: none !important; border: 1px solid #dee2e6 !important; }
}

/* Alerts */
.alert { border-radius: 8px; }

/* Form controls */
.form-control:focus, .form-select:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 0.2rem rgba(41, 128, 185, 0.25);
}

/* Search highlight */
.highlight { background: #fff3cd; border-radius: 3px; padding: 0 2px; }

/* Estoque gauge */
.progress-estoque {
    height: 8px;
    border-radius: 4px;
}

/* Timeline */
.timeline { list-style: none; padding: 0; }
.timeline li {
    border-left: 3px solid var(--color-secondary);
    padding: 0 0 1rem 1.25rem;
    position: relative;
    margin-left: 0.5rem;
}
.timeline li::before {
    content: '';
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--color-secondary);
    position: absolute;
    left: -7.5px; top: 4px;
}
.timeline li:last-child { border-left-color: transparent; }
