/* ==============================================
   MAH GestionResto — Design System
   ============================================== */

:root {
    --brand:          #FF6B00;
    --brand-dark:     #E55100;
    --brand-light:    #FFF4EC;
    --brand-gradient: linear-gradient(135deg, #FF6B00 0%, #FF9500 100%);
    --sidebar-width:  240px;
    --sidebar-bg:     #FFFFFF;
    --page-bg:        #F8F7F4;
    --border:         #EDE9E4;
    --text-1:         #1C1917;
    --text-2:         #78716C;
    --text-3:         #A8A29E;
    --card-shadow:    0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.06);
    --radius-xl:      20px;
    --radius-lg:      16px;
    --radius-md:      12px;
    --radius-sm:      8px;
    --topbar-h:       56px;
}

*, *::before, *::after { box-sizing: border-box; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-wrap {
    min-height: 100vh;
    display: flex;
}

/* — Left orange panel — */
.login-hero {
    flex: 0 0 42%;
    background: var(--brand-gradient);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 3.5rem;
    color: #fff;
}

/* decorative concentric circles */
.login-hero::before {
    content: '';
    position: absolute;
    width: 420px; height: 420px;
    top: -90px; right: -110px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.15);
    pointer-events: none;
}
.login-hero::after {
    content: '';
    position: absolute;
    width: 650px; height: 650px;
    bottom: -220px; right: -190px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.1);
    pointer-events: none;
}
.hero-circle-mid {
    position: absolute;
    width: 280px; height: 280px;
    top: 30%; right: -60px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.12);
    pointer-events: none;
}

.hero-logo {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-bottom: 3.5rem;
    position: relative;
}
.hero-logo-icon {
    width: 46px; height: 46px;
    background: rgba(255,255,255,.2);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem;
    backdrop-filter: blur(4px);
}
.hero-logo-name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.01em;
}

.hero-headline {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 1rem;
    position: relative;
}
.hero-headline em {
    font-style: normal;
    color: rgba(255,255,255,.75);
}

.hero-sub {
    font-size: .95rem;
    color: rgba(255,255,255,.8);
    line-height: 1.65;
    margin-bottom: 2.5rem;
    position: relative;
}

.hero-features {
    list-style: none;
    padding: 0; margin: 0;
    position: relative;
}
.hero-features li {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .5rem 0;
    font-size: .88rem;
    color: rgba(255,255,255,.85);
}
.hero-feat-dot {
    width: 28px; height: 28px;
    background: rgba(255,255,255,.18);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: .75rem;
}

/* — Right form panel — */
.login-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: #FAFAF8;
    overflow-y: auto;
}
.login-form-inner { width: 100%; max-width: 400px; }

.login-tabs {
    display: flex;
    background: #EEEBE6;
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 2.25rem;
}
.login-tab {
    flex: 1;
    text-align: center;
    padding: .55rem .5rem;
    font-size: .88rem;
    font-weight: 600;
    border-radius: 9px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-2);
    background: transparent;
    transition: all .15s;
    display: block;
}
.login-tab.active {
    background: #fff;
    color: var(--text-1);
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

.login-welcome { margin-bottom: 1.75rem; }
.login-welcome h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-1);
    margin: 0 0 .3rem;
}
.login-welcome p { font-size: .9rem; color: var(--text-2); margin: 0; }

.lbl { font-size: .84rem; font-weight: 600; color: var(--text-1); margin-bottom: .4rem; display: block; }

.inp {
    width: 100%;
    padding: .75rem 1rem;
    border: 1.5px solid #EDE9E4;
    border-radius: var(--radius-md);
    font-size: .95rem;
    color: var(--text-1);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,107,0,.12); }
.inp::placeholder { color: var(--text-3); }

.inp-wrap { position: relative; }
.inp-wrap .inp { padding-right: 2.9rem; }
.inp-eye {
    position: absolute;
    right: .9rem; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--text-3); cursor: pointer;
    font-size: 1rem; padding: 0;
}
.inp-eye:hover { color: var(--text-2); }

.form-check-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.form-check-row .form-check { margin: 0; }
.form-check-row .form-check-label { font-size: .85rem; color: var(--text-2); }
.form-check-row .lnk-brand {
    font-size: .85rem;
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}
.form-check-row .lnk-brand:hover { text-decoration: underline; }

.btn-login {
    width: 100%;
    padding: .875rem;
    background: var(--brand);
    color: #fff; border: none;
    border-radius: var(--radius-md);
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.btn-login:hover { background: var(--brand-dark); }
.btn-login:active { transform: scale(.98); }

.login-alt {
    text-align: center;
    margin-top: 1.5rem;
    font-size: .875rem;
    color: var(--text-2);
}
.login-alt a { color: var(--brand); font-weight: 600; text-decoration: none; }
.login-alt a:hover { text-decoration: underline; }

.login-demo {
    margin-top: 1.25rem;
    padding: .75rem 1rem;
    background: #F5F3F0;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: .78rem;
    color: var(--text-2);
}

/* Legacy centered-card login (used by Register.cshtml) */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-gradient);
    padding: 1.5rem;
}
.login-card {
    background: #fff; border-radius: var(--radius-lg);
    padding: 2.5rem 2rem; width: 100%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-logo { text-align: center; margin-bottom: 1.75rem; }
.login-logo i { font-size: 2.5rem; color: var(--brand); }
.login-logo h1 { font-size: 1.3rem; font-weight: 800; margin: .4rem 0 .2rem; color: var(--text-1); }
.login-logo p  { font-size: .85rem; color: var(--text-2); margin: 0; }
.login-footer  { text-align: center; margin-top: 1.25rem; font-size: .875rem; color: var(--text-2); }
.login-footer a { color: var(--brand); font-weight: 600; }

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */

.admin-body  { margin: 0; background: var(--page-bg); }
.admin-wrapper { display: flex; min-height: 100vh; }

/* — Sidebar — */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform .25s, width .2s;
    overflow: hidden;
}

.sidebar-brand {
    padding: 1.15rem 1rem;
    display: flex;
    align-items: center;
    gap: .7rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.brand-icon {
    width: 36px; height: 36px;
    background: var(--brand-gradient);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.05rem;
    flex-shrink: 0;
}
.brand-name { font-size: .93rem; font-weight: 800; color: var(--text-1); white-space: nowrap; }

/* Pending orders alert pill */
.sidebar-alert {
    margin: .65rem .75rem .1rem;
    padding: .45rem .75rem;
    background: #FFF8E1;
    border: 1px solid #FFD54F;
    border-radius: var(--radius-md);
    font-size: .77rem;
    font-weight: 600;
    color: #7B5E00;
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}
.sidebar-alert:hover { background: #FFF3C4; }
.sidebar-alert i { color: #D97706; }

/* Nav */
.sidebar-nav {
    list-style: none;
    padding: .5rem .6rem;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .58rem .75rem;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    transition: all .15s;
    white-space: nowrap;
    margin-bottom: 1px;
}
.sidebar-nav li a i { font-size: .95rem; width: 18px; flex-shrink: 0; }
.sidebar-nav li a span { flex: 1; }
.sidebar-nav li a:hover  { background: var(--brand-light); color: var(--brand); }
.sidebar-nav li a.active { background: var(--brand-light); color: var(--brand); font-weight: 700; }
.sidebar-nav li a .badge { margin-left: auto; font-size: .68rem; }

/* User footer */
.sidebar-user {
    padding: .8rem .75rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-shrink: 0;
}
.user-avatar {
    width: 34px; height: 34px;
    background: var(--brand-gradient);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: .85rem; font-weight: 700;
    flex-shrink: 0; text-transform: uppercase;
}
.user-name-text {
    font-size: .8rem; font-weight: 700;
    color: var(--text-1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 118px;
}
.user-role-text { font-size: .7rem; color: var(--text-3); white-space: nowrap; }
.logout-btn {
    background: none; border: none;
    color: var(--text-3);
    cursor: pointer; padding: .3rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all .15s;
    flex-shrink: 0; margin-left: auto;
    display: flex; align-items: center;
}
.logout-btn:hover { background: #FEE2E2; color: #DC2626; }

/* — Main — */
.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Mobile-only topbar */
.admin-topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: none;
    align-items: center;
    padding: 0 1.25rem;
    gap: 1rem;
    position: sticky; top: 0; z-index: 50;
}
.topbar-brand { font-size: .95rem; font-weight: 800; color: var(--text-1); flex: 1; }
.sidebar-toggle {
    background: none; border: none;
    font-size: 1.3rem; cursor: pointer;
    color: var(--text-1); padding: .25rem;
    border-radius: var(--radius-sm);
}
.topbar-avatar {
    width: 32px; height: 32px;
    background: var(--brand-gradient);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: .78rem; font-weight: 700;
    text-transform: uppercase;
}

/* Content area */
.admin-content { padding: 1.75rem; flex: 1; }

/* Page header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}
.page-title { font-size: 1.55rem; font-weight: 800; color: var(--text-1); margin: 0 0 .2rem; }
.page-subtitle { font-size: .875rem; color: var(--text-2); margin: 0; }
.page-actions { display: flex; gap: .6rem; align-items: center; flex-shrink: 0; flex-wrap: wrap; }

/* ============================================================
   SHARED COMPONENTS
   ============================================================ */

/* Buttons */
.btn-brand {
    background: var(--brand); color: #fff;
    border: none; border-radius: var(--radius-md);
    padding: .6rem 1.1rem;
    font-size: .875rem; font-weight: 700;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: .4rem;
    text-decoration: none;
    transition: background .15s, transform .1s;
}
.btn-brand:hover  { background: var(--brand-dark); color: #fff; }
.btn-brand:active { transform: scale(.97); }

.btn-ghost {
    background: #fff; color: var(--text-1);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: .58rem 1rem;
    font-size: .875rem; font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: .4rem;
    text-decoration: none;
    transition: all .15s;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }

.btn-icon {
    width: 36px; height: 36px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-2);
    font-size: 1rem;
    transition: all .15s;
    flex-shrink: 0;
}
.btn-icon:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }

/* — Stat cards — */
.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--card-shadow);
}
.stat-label {
    font-size: .78rem;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: .5rem;
    display: flex; align-items: center; gap: .35rem;
}
.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-1);
    line-height: 1;
    margin-bottom: .15rem;
}
.stat-sub { font-size: .75rem; color: var(--text-3); }
.ic-orange { color: var(--brand); }
.ic-green  { color: #16A34A; }
.ic-amber  { color: #D97706; }
.ic-blue   { color: #2563EB; }
.ic-purple { color: #7C3AED; }

/* — RF Cards — */
.rf-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.rf-card-header {
    padding: .9rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    justify-content: space-between;
    font-weight: 700; font-size: .875rem;
    color: var(--text-1);
}
.rf-card-body { padding: 1.25rem; }
.rf-card-body.p0 { padding: 0; }

/* — Data lists — */
.data-list { list-style: none; padding: 0; margin: 0; }
.data-list li {
    display: flex; align-items: center; gap: .6rem;
    padding: .65rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: .85rem;
}
.data-list li:last-child { border-bottom: none; }
.dl-rank { color: var(--text-3); font-size: .75rem; min-width: 18px; }
.dl-name { flex: 1; font-weight: 500; color: var(--text-1); }
.dl-qty  { font-weight: 700; color: var(--brand); min-width: 38px; }
.dl-rev  { font-size: .78rem; color: var(--text-2); min-width: 80px; text-align: right; }
.dl-ref  { font-family: monospace; font-size: .75rem; flex: 1; color: var(--text-2); }
.dl-time { color: var(--text-3); font-size: .75rem; }
.dl-total{ font-weight: 700; min-width: 82px; text-align: right; color: var(--text-1); }

/* — Products Admin Grid — */
.category-heading {
    color: var(--brand); font-size: .82rem;
    text-transform: uppercase; letter-spacing: .07em; font-weight: 700;
}
.products-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .75rem;
}
.product-admin-card {
    background: #fff;
    border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--card-shadow);
    display: flex; flex-direction: column;
    transition: box-shadow .15s, transform .15s;
}
.product-admin-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.1); transform: translateY(-2px); }
.pac-image { height: 100px; overflow: hidden; background: #f8f9fa; }
.pac-image img { width: 100%; height: 100%; object-fit: cover; }
.pac-no-img { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #ced4da; }
.pac-body { padding: .6rem .75rem; flex: 1; }
.pac-name  { font-weight: 600; font-size: .875rem; margin-bottom: .1rem; color: var(--text-1); }
.pac-price { color: var(--brand); font-weight: 700; font-size: .875rem; }
.pac-desc  { font-size: .75rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pac-actions { display: flex; gap: .25rem; padding: .5rem .75rem; border-top: 1px solid var(--border); background: #fafafa; }

/* Legacy aliases — keeps existing pages working */
.metric-card {
    background: #fff; border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem; box-shadow: var(--card-shadow);
    display: flex; align-items: center; gap: 1rem;
}
.metric-icon {
    font-size: 1.4rem; width: 44px; height: 44px;
    border-radius: 10px; background: var(--brand-light);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.metric-revenue .metric-icon { color: #16A34A; background: #DCFCE7; }
.metric-orders  .metric-icon { color: var(--brand); background: var(--brand-light); }
.metric-ticket  .metric-icon { color: #2563EB; background: #DBEAFE; }
.metric-products .metric-icon { color: #7C3AED; background: #EDE9FE; }
.metric-value { font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--text-1); }
.metric-value small { font-size: .7rem; font-weight: 400; color: var(--text-2); }
.metric-label { font-size: .78rem; color: var(--text-2); }
.top-products-list { list-style: none; padding: 0; margin: 0; }
.top-products-list li { display: flex; align-items: center; gap: .5rem; padding: .6rem 1rem; border-bottom: 1px solid var(--border); font-size: .875rem; }
.tp-name { flex: 1; font-weight: 500; }
.tp-qty  { font-weight: 700; color: var(--brand); min-width: 40px; }
.tp-rev  { font-size: .8rem; color: var(--text-2); min-width: 80px; text-align: right; }
.recent-orders-list { list-style: none; padding: 0; margin: 0; }
.recent-orders-list li { display: flex; align-items: center; gap: .5rem; padding: .5rem 1rem; border-bottom: 1px solid var(--border); font-size: .85rem; }
.ro-ref   { font-family: monospace; font-size: .75rem; flex: 1; }
.ro-time  { color: var(--text-2); font-size: .75rem; }
.ro-total { font-weight: 700; min-width: 80px; text-align: right; }
.quick-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.btn-connect {
    background: var(--brand); border-color: var(--brand);
    font-weight: 600; color: #fff;
}
.btn-connect:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 767px) {
    .login-hero       { display: none; }
    .login-form-panel { padding: 2rem 1.5rem; }

    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.12); }
    .admin-main       { margin-left: 0; }
    .admin-topbar     { display: flex; }
    .admin-content    { padding: 1rem; }
    .page-title       { font-size: 1.25rem; }
    .page-header      { margin-bottom: 1.25rem; }
    .products-admin-grid { grid-template-columns: 1fr 1fr; }
    .quick-actions    { flex-direction: column; }
}

@media (min-width: 768px) and (max-width: 1199px) {
    :root { --sidebar-width: 210px; }
    .products-admin-grid { grid-template-columns: repeat(3, 1fr); }
}
