/* ============================================================
   OLAS - App Styles
   ============================================================ */

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1f2937;
    background: #f3f4f6;
}

/* ============================================================
   LAYOUT
   ============================================================ */
#wrapper {
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1030;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #111827;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
}

.sidebar-brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.brand-initial {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--olas-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-menu {
    padding: 0.75rem 0;
}

.sidebar-section {
    padding: 0.75rem 1.25rem 0.4rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 1.25rem;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.92rem;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.sidebar-link:hover {
    background: #f9fafb;
    color: var(--olas-primary);
}

.sidebar-link.active {
    background: #eff6ff;
    color: var(--olas-primary);
    border-left-color: var(--olas-primary);
    font-weight: 600;
}

.sidebar-link i {
    font-size: 1.05rem;
    width: 1.2rem;
    text-align: center;
}

/* ============================================================
   CONTENT
   ============================================================ */
.content-wrapper {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-title {
    font-weight: 600;
    color: #111827;
    font-size: 1.05rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--olas-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.page-content {
    padding: 1.5rem;
    flex-grow: 1;
}

.page-footer {
    border-top: 1px solid #e5e7eb;
    background: #fff;
    padding: 1rem 1.5rem;
    color: #6b7280;
    font-size: 0.85rem;
    text-align: center;
}

/* ============================================================
   COMPONENTS
   ============================================================ */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.stat-card .stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    color: #6b7280;
    font-size: 0.85rem;
    margin: 0;
}

.icon-bg-primary { background: #dbeafe; color: #1d4ed8; }
.icon-bg-success { background: #dcfce7; color: #15803d; }
.icon-bg-warning { background: #fef3c7; color: #b45309; }
.icon-bg-info    { background: #cffafe; color: #0e7490; }
.icon-bg-danger  { background: #fee2e2; color: #b91c1c; }
.icon-bg-purple  { background: #ede9fe; color: #6d28d9; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.page-subtitle { color: #6b7280; margin: 0.25rem 0 0; font-size: 0.9rem; }

.card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: none;
}

.card-header {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.85rem 1.25rem;
    font-weight: 600;
}

.btn-primary {
    background: var(--olas-primary);
    border-color: var(--olas-primary);
}

.btn-primary:hover, .btn-primary:focus {
    background: color-mix(in srgb, var(--olas-primary) 85%, black);
    border-color: color-mix(in srgb, var(--olas-primary) 85%, black);
}

.text-primary-custom { color: var(--olas-primary) !important; }

table { font-size: 0.92rem; }
.table th { font-weight: 600; color: #4b5563; background: #f9fafb; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        box-shadow: 2px 0 12px rgba(0,0,0,0.15);
    }
    .sidebar.show { transform: translateX(0); }
    .content-wrapper { width: 100%; }
}
