/* Restaurant Expense Management System - shared styles */
/* Location: /assets/css/app.css */

:root {
    --rems-primary: #4361ee;
    --rems-primary-dark: #3a4fd8;
    --rems-sidebar-bg: #1e2337;
    --rems-sidebar-active: #4361ee;
}

body {
    background-color: #f4f6fb;
}

/* DataTables' Buttons extension renders inside a Bootstrap .btn-group, which sets
   flex:1 on children (for equal-width segmented controls) - not what we want for
   a compact Excel/CSV/Print toolbar, so it needs an explicit override. */
.dt-buttons.btn-group {
    display: inline-flex;
}
.dt-buttons.btn-group > .btn {
    flex: 0 0 auto;
}

/* ---------- Login page ---------- */
.login-body {
    background: linear-gradient(135deg, var(--rems-primary) 0%, #7048e8 100%);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: 1rem;
}

.login-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(67, 97, 238, 0.1);
    color: var(--rems-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

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

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--rems-primary-dark);
    border-color: var(--rems-primary-dark);
}

/* ---------- Admin layout ---------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--rems-sidebar-bg);
    color: #cfd2e3;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    overflow-y: auto;
    transition: transform .2s ease, width .2s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #fff;
    font-size: 1.15rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    white-space: nowrap;
}

.sidebar-brand i { font-size: 1.4rem; color: var(--rems-primary); }

.sidebar-nav { padding: .75rem 0; }

.sidebar-nav .nav-link {
    color: #cfd2e3;
    padding: .65rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

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

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: rgba(67, 97, 238, .15);
    color: #fff;
    border-left-color: var(--rems-sidebar-active);
}

.main-content {
    margin-left: 250px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 250px);
}

.app-wrapper.sidebar-collapsed .sidebar { transform: translateX(-250px); }
.app-wrapper.sidebar-collapsed .main-content { margin-left: 0; width: 100%; }

.topbar {
    background: #fff;
    border-bottom: 1px solid #e6e8f0;
    padding: .65rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.btn-icon {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    color: #495066;
    line-height: 1;
    padding: .25rem .5rem;
}

.btn-user {
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--rems-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.app-footer { color: #98a1b3; }

/* ---------- Dashboard KPI cards ---------- */
.kpi-card {
    border: none;
    border-radius: .75rem;
    box-shadow: 0 2px 10px rgba(20, 25, 60, .05);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: .65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.kpi-value { font-size: 1.5rem; font-weight: 700; }

.chart-card {
    border: none;
    border-radius: .75rem;
    box-shadow: 0 2px 10px rgba(20, 25, 60, .05);
}

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-250px); }
    .app-wrapper.sidebar-open .sidebar { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
}

/* ---------- Print (bill receipts etc.) ---------- */
@media print {
    .sidebar, .topbar, .app-footer, .d-print-none {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .page-content {
        padding: 0 !important;
    }
}
