/**
 * Restaurant POS & Management System
 * Custom Stylesheet
 * Modern, Clean SaaS Aesthetic with Slate & Deep Teal Theme (Zero Gradients)
 */

:root {
    --app-bg: #f8fafc;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #0f766e;
    --sidebar-text: #94a3b8;
    --sidebar-text-bright: #f8fafc;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 72px;
    
    --topbar-height: 64px;
    --topbar-bg: #ffffff;
    --topbar-border: #e2e8f0;
    
    --card-border: #e2e8f0;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    
    --primary-color: #0f766e;
    --primary-hover: #115e59;
    --primary-focus-ring: rgba(15, 118, 110, 0.25);
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--app-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Primary Button Customization (Solid, No Gradients) */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    font-weight: 500;
    padding: 0.5rem 1.2rem;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.25rem var(--primary-focus-ring) !important;
}

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

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

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

.bg-primary-theme {
    background-color: var(--primary-color) !important;
}

/* ========================================================
   Main Layout Wrapper
   ======================================================== */
#app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ========================================================
   Sidebar
   ======================================================== */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease-in-out, min-width 0.25s ease-in-out;
    z-index: 1040;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
}

#sidebar .sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    background-color: #0b1120;
    border-bottom: 1px solid #1e293b;
    text-decoration: none;
    color: var(--sidebar-text-bright);
    white-space: nowrap;
    overflow: hidden;
}

#sidebar .sidebar-brand i {
    font-size: 1.5rem;
    color: #2dd4bf;
    min-width: 32px;
}

#sidebar .sidebar-brand span {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-left: 0.5rem;
    transition: opacity 0.2s ease;
}

#sidebar .sidebar-menu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0;
}

#sidebar .sidebar-heading {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.75rem 1.25rem 0.35rem;
    font-weight: 700;
    white-space: nowrap;
}

#sidebar .nav-item {
    margin: 0.15rem 0.75rem;
}

#sidebar .nav-link {
    display: flex;
    align-items: center;
    color: var(--sidebar-text);
    padding: 0.65rem 0.85rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s ease-in-out;
}

#sidebar .nav-link i {
    font-size: 1.2rem;
    min-width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#sidebar .nav-link span {
    margin-left: 0.65rem;
    transition: opacity 0.2s ease;
}

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

#sidebar .nav-link.active {
    color: #ffffff;
    background-color: var(--sidebar-active);
}

#sidebar .nav-link.active i {
    color: #ffffff;
}

/* Collapsed Sidebar */
#app-wrapper.sidebar-collapsed #sidebar {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
}

#app-wrapper.sidebar-collapsed #sidebar .sidebar-brand span,
#app-wrapper.sidebar-collapsed #sidebar .nav-link span,
#app-wrapper.sidebar-collapsed #sidebar .sidebar-heading {
    display: none;
}

#app-wrapper.sidebar-collapsed #sidebar .nav-item {
    margin: 0.25rem 0.5rem;
}

#app-wrapper.sidebar-collapsed #sidebar .nav-link {
    justify-content: center;
    padding: 0.65rem 0;
}

#app-wrapper.sidebar-collapsed #sidebar .nav-link i {
    min-width: unset;
    margin: 0;
}

/* ========================================================
   Content Area & Topbar
   ======================================================== */
#content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.25s ease-in-out;
    background-color: var(--app-bg);
}

#app-wrapper.sidebar-collapsed #content-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

#topbar {
    height: var(--topbar-height);
    background-color: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.sidebar-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.35rem;
    padding: 0.35rem 0.6rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-toggle-btn:hover {
    background-color: #f1f5f9;
    color: var(--text-primary);
}

/* Avatar Images */
.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.profile-avatar-large {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e2e8f0;
    background-color: #ffffff;
}

/* ========================================================
   Main Page Content & Cards
   ======================================================== */
#main-content {
    flex: 1;
    padding: 1.75rem;
}

.card {
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
    box-shadow: var(--card-shadow);
    background-color: #ffffff;
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* Metric / Stat Card */
.stat-card {
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
    padding: 1.25rem;
    background-color: #ffffff;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

/* Footer */
#app-footer {
    background-color: #ffffff;
    border-top: 1px solid var(--topbar-border);
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ========================================================
   Responsive Media Queries
   ======================================================== */
@media (max-width: 991.98px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    
    #content-wrapper {
        margin-left: 0 !important;
    }
    
    #app-wrapper.sidebar-open #sidebar {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(15, 23, 42, 0.5);
        z-index: 1035;
    }
    
    #app-wrapper.sidebar-open .sidebar-overlay {
        display: block;
    }
}
