@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

:root {
    --primary-red: #f32c2c;
    --primary-red-hover: #d91c1c;
    --sidebar-bg: #1a1d2e;
    --sidebar-width: 240px;
    --topbar-height: 64px;
    --text-gray: #777;
    --light-gray: #f4f6f9;
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
    --radius: 14px;
    --transition: 0.25s ease;
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--light-gray);
    color: #2d2d2d;
    min-height: 100vh;
    display: flex;
}

/* ============================
   SIDEBAR
   ============================ */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

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

.brand-food  { color: var(--primary-red); }
.brand-app   { color: #5b8dee; }
.brand-ver   { color: rgba(255,255,255,0.4); font-size: 0.7rem; font-weight: 400; margin-left: 2px; }

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    padding: 6px 8px 4px;
    margin-bottom: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,0.55);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
    margin-bottom: 3px;
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
}

.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    text-decoration: none;
}

.nav-item.active {
    background: linear-gradient(135deg, #f32c2c, #d91c1c);
    color: #fff;
    box-shadow: 0 4px 14px rgba(243,44,44,0.35);
}

.nav-item-logout {
    color: rgba(243,44,44,0.7) !important;
}
.nav-item-logout:hover {
    background: rgba(243,44,44,0.15) !important;
    color: #f32c2c !important;
}

/* ============================
   MAIN WRAPPER
   ============================ */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================
   TOPBAR
   ============================ */
.topbar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid #eef0f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #888;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all var(--transition);
    display: none; /* show on mobile via media query */
}
.sidebar-toggle:hover { background: var(--light-gray); color: #444; }

.topbar-breadcrumb { display: flex; flex-direction: column; }
.breadcrumb-page { font-weight: 700; font-size: 0.95rem; color: #1a1d2e; }
.breadcrumb-sub  { font-size: 0.75rem; color: #aaa; margin-top: 1px; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Notification Bell */
.topbar-notif {
    position: relative;
    color: #888;
    font-size: 1.1rem;
    cursor: pointer;
}
.notif-badge {
    position: absolute;
    top: -6px; right: -8px;
    background: var(--primary-red);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 50%;
    width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
}

/* Profile */
.topbar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
    padding: 6px 14px 6px 8px;
    border-radius: 50px;
    background: var(--light-gray);
    transition: background var(--transition);
}
.topbar-profile:hover { background: #eaedf4; }

.profile-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f32c2c, #d91c1c);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 0.85rem;
}

.profile-info { display: flex; flex-direction: column; }
.profile-name { font-size: 0.82rem; font-weight: 700; color: #1a1d2e; line-height: 1.2; }
.profile-role { font-size: 0.68rem; color: #aaa; }

.profile-caret {
    font-size: 0.65rem;
    color: #bbb;
    transition: transform var(--transition);
}
.profile-caret.open { transform: rotate(180deg); }

/* Profile Dropdown */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 230px;
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.14);
    border: 1px solid #f0f0f0;
    display: none;
    z-index: 200;
    overflow: hidden;
    animation: dropFade 0.2s ease;
}

@keyframes dropFade {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #fff5f5, #fff);
}
.dh-avatar { font-size: 2rem; color: var(--primary-red); }
.dh-name   { font-weight: 700; font-size: 0.85rem; color: #1a1d2e; }
.dh-role   { font-size: 0.72rem; color: #aaa; }

.dropdown-item-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    font-size: 0.83rem;
    color: #444;
    text-decoration: none;
    transition: background var(--transition);
}
.dropdown-item-custom:hover { background: var(--light-gray); color: #1a1d2e; text-decoration: none; }
.dropdown-item-custom.text-danger { color: var(--primary-red) !important; }
.dropdown-item-custom.text-danger:hover { background: #fff5f5; }
.dropdown-item-custom i { width: 16px; text-align: center; }

.dropdown-divider { border: none; border-top: 1px solid #f0f0f0; margin: 4px 0; }

/* ============================
   PAGE CONTENT
   ============================ */
.page-content {
    padding: 28px;
    flex: 1;
}

/* ============================
   STAT CARDS
   ============================ */
.stat-card {
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    border-left: 4px solid transparent;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card-red   { border-left-color: #f32c2c; }
.stat-card-blue  { border-left-color: #5b8dee; }
.stat-card-green { border-left-color: #2ecb71; }
.stat-card-orange{ border-left-color: #ff9f43; }

.stat-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.stat-card-red   .stat-icon { background: #fff0f0; color: #f32c2c; }
.stat-card-blue  .stat-icon { background: #eef3ff; color: #5b8dee; }
.stat-card-green .stat-icon { background: #eefaf4; color: #2ecb71; }
.stat-card-orange.stat-icon { background: #fff6ed; color: #ff9f43; }

/* Fix: orange icon needs the class on the right element */
.stat-card-orange .stat-icon { background: #fff6ed; color: #ff9f43; }

.stat-value { font-size: 1.4rem; font-weight: 700; color: #1a1d2e; line-height: 1; }
.stat-label { font-size: 0.75rem; color: #aaa; margin-top: 4px; }

/* ============================
   SECTION HEADER
   ============================ */
.section-header { border-left: 4px solid var(--primary-red); padding-left: 14px; }
.section-title  { font-size: 1rem; font-weight: 700; color: #1a1d2e; margin-bottom: 2px; }
.section-sub    { font-size: 0.8rem; color: #aaa; }

/* ============================
   MENU CARDS
   ============================ */
.menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-decoration: none;
    color: #1a1d2e;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    text-align: center;
    height: 100%;
}
.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: #1a1d2e;
}

.menu-card-icon {
    width: 60px; height: 60px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 14px;
}

.bg-blue   { background: linear-gradient(135deg, #5b8dee, #3b6fd4); }
.bg-red    { background: linear-gradient(135deg, #f32c2c, #d91c1c); }
.bg-green  { background: linear-gradient(135deg, #2ecb71, #1aab55); }
.bg-orange { background: linear-gradient(135deg, #ff9f43, #e08800); }

.menu-card-label { font-size: 0.88rem; font-weight: 700; margin-bottom: 4px; }
.menu-card-desc  { font-size: 0.74rem; color: #aaa; }

/* ============================
   LOGIN PAGE (index.php)
   ============================ */
.bg-shape-top {
    position: fixed; top: -150px; left: -150px;
    width: 450px; height: 450px;
    background-color: #e62828; border-radius: 50%; z-index: 0;
}
.bg-shape-bottom {
    position: fixed; bottom: -150px; right: -100px;
    width: 350px; height: 350px;
    background-color: #c91818; border-radius: 50%; z-index: 0;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    overflow: hidden;
    z-index: 10;
    width: 100%;
    max-width: 950px;
    min-height: 600px;
}

.left-panel { padding: 50px 60px; display: flex; flex-direction: column; justify-content: center; }
.welcome-text { font-size: 0.8rem; letter-spacing: 2px; color: #888; font-weight: 500; }
.brand-logo {
    color: var(--primary-red); font-weight: 700; font-size: 2.2rem;
    margin-bottom: 10px; display: flex; align-items: center; justify-content: center;
}
.brand-logo i { font-size: 2.5rem; margin-right: 5px; }
.subtitle { font-size: 0.85rem; color: var(--text-gray); margin-bottom: 35px; line-height: 1.6; }

.input-group-custom { position: relative; margin-bottom: 20px; }
.input-group-custom i.icon-left {
    position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
    color: #aaa; z-index: 10;
}
.input-group-custom i.icon-right {
    position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
    color: #ccc; z-index: 10; cursor: pointer; transition: color 0.3s;
}
.input-group-custom i.icon-right:hover { color: var(--primary-red); }

.form-control-custom {
    border-radius: 50px; padding: 12px 20px 12px 50px;
    border: 1px solid #e0e0e0; font-size: 0.9rem;
    box-shadow: none !important; transition: border-color 0.3s; width: 100%;
}
.form-control-custom:focus { border-color: var(--primary-red); outline: none; }

.btn-login {
    background: linear-gradient(to right, #fa3c3c, #e01c1c);
    border: none; border-radius: 50px; padding: 12px;
    color: white; font-weight: 600; letter-spacing: 1px; width: 100%;
    margin-top: 10px; box-shadow: 0 8px 20px rgba(243,44,44,0.4);
    transition: transform 0.2s, box-shadow 0.2s; cursor: pointer;
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(243,44,44,0.5); color: white;
}

.right-panel {
    background-image: url('https://images.unsplash.com/photo-1449824913935-59a10b8d2000?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80');
    background-size: cover; background-position: center;
    position: relative; display: flex; align-items: center;
    justify-content: center; text-align: center; color: white; padding: 40px;
}
.right-panel::before {
    content: ''; position: absolute; top:0;left:0;right:0;bottom:0;
    background: linear-gradient(135deg, rgba(239,83,80,0.85) 0%, rgba(198,40,40,0.95) 100%);
    z-index: 1;
}
.right-content { position: relative; z-index: 2; }
.right-content .logo-white { font-size: 4rem; margin-bottom: 0; }
.right-content h2 { font-weight: 700; letter-spacing: 2px; margin-bottom: 20px; }
.right-content p  { font-size: 0.9rem; line-height: 1.7; opacity: 0.9; max-width: 80%; margin: 0 auto; }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    .main-wrapper { margin-left: 0; }
    .page-content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .left-panel { padding: 40px 30px; }
    .bg-shape-top, .bg-shape-bottom { display: none; }
    .profile-info { display: none; }
}
