﻿/* ============================================================
   WoodCorner Dashboard — Professional Admin Panel
   Brand: #493628 / #7f583c / #b9926d
   ============================================================ */

:root {
    --dash-sidebar-w:  260px;
    --dash-topbar-h:   64px;
    --dash-bg:         #1a0f08;
    --dash-surface:    #231508;
    --dash-surface-2:  #2d1c0e;
    --dash-border:     rgba(185,146,109,.12);
    --dash-text:       #f0e8e0;
    --dash-text-muted: #9a7a62;
    --dash-gold:       #b9926d;
    --dash-gold-dim:   rgba(185,146,109,.12);
    --dash-primary:    #493628;
    --dash-secondary:  #7f583c;
    --dash-success:    #2ecc71;
    --dash-danger:     #e74c3c;
    --dash-warning:    #f39c12;
    --dash-radius:     12px;
}


* { box-sizing: border-box; }
body.dash-body {
    background: var(--dash-bg);
    color: var(--dash-text);
    font-family: 'Cairo', sans-serif;
    margin: 0; padding: 0;
    min-height: 100vh;
    display: flex;
}

/* ?? SIDEBAR ???????????????????????????????????????????????? */
.dash-sidebar {
    width: var(--dash-sidebar-w);
    min-height: 100vh;
    background: var(--dash-surface);
    border-left: 1px solid var(--dash-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 100;
    transition: width .3s ease;
    overflow: hidden;
}
.dash-sidebar.collapsed { width: 70px; }

.dash-sidebar__logo {
    padding: 1.5rem 1.2rem;
    border-bottom: 1px solid var(--dash-border);
    text-decoration: none;
}
.dash-sidebar__logo a { text-decoration: none; }
.dash-sidebar__logo-ar {
    font-size: 1.1rem; font-weight: 800;
    color: var(--dash-gold);
    white-space: nowrap;
}
.dash-sidebar__logo-en {
    font-size: .6rem; letter-spacing: 4px;
    color: var(--dash-text-muted);
    text-transform: uppercase;
}
.dash-sidebar.collapsed .dash-sidebar__logo-ar,
.dash-sidebar.collapsed .dash-sidebar__logo-en { display: none; }

.dash-sidebar__nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.dash-sidebar__section-label {
    font-size: .68rem; letter-spacing: 2px; text-transform: uppercase;
    color: var(--dash-text-muted); padding: .8rem 1.2rem .3rem;
    white-space: nowrap;
}
.dash-sidebar.collapsed .dash-sidebar__section-label { opacity: 0; }
.dash-sidebar__menu { list-style: none; margin: 0; padding: 0; }
.dash-sidebar__link {
    display: flex; align-items: center; gap: .8rem;
    padding: .7rem 1.2rem;
    color: var(--dash-text-muted);
    text-decoration: none;
    font-size: .9rem; font-weight: 500;
    border-radius: 0;
    transition: all .2s;
    position: relative;
    white-space: nowrap;
}
.dash-sidebar__link i { font-size: 1.15rem; min-width: 20px; text-align: center; }
.dash-sidebar__link:hover { color: var(--dash-text); background: var(--dash-surface-2); }
.dash-sidebar__link.active {
    color: var(--dash-gold);
    background: var(--dash-gold-dim);
    border-right: 3px solid var(--dash-gold);
}
.dash-sidebar.collapsed .dash-sidebar__link span { display: none; }
.dash-sidebar__footer {
    padding: 1rem 1.2rem;
    border-top: 1px solid var(--dash-border);
}
.dash-sidebar__site-link {
    display: flex; align-items: center; gap: .6rem;
    color: var(--dash-text-muted); font-size: .85rem;
    text-decoration: none; transition: color .2s;
}
.dash-sidebar__site-link:hover { color: var(--dash-gold); }
.dash-sidebar.collapsed .dash-sidebar__site-link span { display: none; }

/* ?? MAIN ??????????????????????????????????????????????????? */
.dash-main {
    margin-right: var(--dash-sidebar-w);
    min-height: 100vh;
    flex: 1;
    display: flex; flex-direction: column;
    transition: margin-right .3s ease;
}
.dash-main.expanded { margin-right: 70px; }

/* ?? TOPBAR ????????????????????????????????????????????????? */
.dash-topbar {
    height: var(--dash-topbar-h);
    background: var(--dash-surface);
    border-bottom: 1px solid var(--dash-border);
    display: flex; align-items: center;
    padding: 0 1.5rem; gap: 1rem;
    position: sticky; top: 0; z-index: 99;
}
.dash-topbar__toggle {
    background: none; border: none; color: var(--dash-text-muted);
    font-size: 1.4rem; cursor: pointer; padding: .3rem;
    transition: color .2s;
}
.dash-topbar__toggle:hover { color: var(--dash-gold); }
.dash-topbar__breadcrumb {
    flex: 1; font-size: .95rem; font-weight: 600; color: var(--dash-text);
}
.dash-topbar__user-btn {
    background: var(--dash-surface-2); border: 1px solid var(--dash-border);
    color: var(--dash-text); padding: .4rem .9rem;
    border-radius: 50px; font-size: .85rem;
    display: flex; align-items: center; gap: .5rem;
    transition: all .2s;
}
.dash-topbar__user-btn:hover { border-color: var(--dash-gold); color: var(--dash-gold); }
.dash-topbar__avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--dash-gold-dim); border: 1px solid var(--dash-gold);
    display: flex; align-items: center; justify-content: center;
    color: var(--dash-gold);
}

/* ?? CONTENT ???????????????????????????????????????????????? */
.dash-content { padding: 1.5rem 2rem; flex: 1; }

/* ?? CARDS ?????????????????????????????????????????????????? */
.dash-card {
    background: var(--dash-surface);
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius);
    overflow: hidden;
}
.dash-card__header {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--dash-border);
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
}
.dash-card__title {
    font-size: 1rem; font-weight: 700; color: var(--dash-text); margin: 0;
}
.dash-card__body { padding: 1.5rem; }

/* ?? STAT CARDS ????????????????????????????????????????????? */
.dash-stat {
    background: var(--dash-surface);
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius);
    padding: 1.5rem;
    display: flex; align-items: center; gap: 1rem;
    transition: border-color .2s;
}
.dash-stat:hover { border-color: var(--dash-gold); }
.dash-stat__icon {
    width: 56px; height: 56px; border-radius: 12px;
    background: var(--dash-gold-dim); border: 1px solid rgba(196,151,59,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: var(--dash-gold);
    flex-shrink: 0;
}
.dash-stat__info { flex: 1; }
.dash-stat__num { font-size: 1.8rem; font-weight: 800; color: var(--dash-text); line-height: 1; }
.dash-stat__label { font-size: .8rem; color: var(--dash-text-muted); margin-top: .2rem; }

/* ?? TABLE ?????????????????????????????????????????????????? */
.dash-table { width: 100%; border-collapse: separate; border-spacing: 0; }
/* Reset Bootstrap table bg overrides */
.dash-table,
.dash-table thead,
.dash-table tbody,
.dash-table tfoot,
.dash-table tr,
.dash-table th,
.dash-table td {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: transparent;
    --bs-table-hover-bg: transparent;
    background-color: transparent !important;
}
.dash-table th {
    background: var(--dash-surface-2) !important;
    color: var(--dash-text-muted); font-size: .78rem;
    font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
    padding: .8rem 1rem; border-bottom: 1px solid var(--dash-border);
}
.dash-table td {
    padding: .85rem 1rem; color: var(--dash-text);
    border-bottom: 1px solid var(--dash-border);
    font-size: .9rem; vertical-align: middle;
}
.dash-table tbody tr { transition: background .15s; }
.dash-table tbody tr:hover td { background: var(--dash-surface-2) !important; }
.dash-table tbody tr:last-child td { border-bottom: none; }

/* ?? BADGE STATUS ??????????????????????????????????????????? */
.dash-badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .25rem .7rem; border-radius: 50px;
    font-size: .75rem; font-weight: 600;
}
.dash-badge--success { background: rgba(46,204,113,.12); color: var(--dash-success); border: 1px solid rgba(46,204,113,.2); }
.dash-badge--danger  { background: rgba(231,76,60,.12);  color: var(--dash-danger);  border: 1px solid rgba(231,76,60,.2); }
.dash-badge--gold    { background: var(--dash-gold-dim); color: var(--dash-gold);   border: 1px solid rgba(196,151,59,.2); }

/* ?? BUTTONS ???????????????????????????????????????????????? */
.dash-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem 1.1rem; border-radius: 8px;
    font-size: .85rem; font-weight: 600; cursor: pointer;
    border: 1px solid transparent; transition: all .2s;
    text-decoration: none;
}
.dash-btn--gold    { background: var(--dash-gold);    color: #fff; border-color: var(--dash-gold); }
.dash-btn--gold:hover { background: #B8860B; color: #fff; }
.dash-btn--outline { background: transparent; color: var(--dash-text-muted); border-color: var(--dash-border); }
.dash-btn--outline:hover { border-color: var(--dash-gold); color: var(--dash-gold); }
.dash-btn--danger  { background: transparent; color: var(--dash-danger); border-color: rgba(231,76,60,.3); }
.dash-btn--danger:hover { background: rgba(231,76,60,.1); }
.dash-btn--sm { padding: .3rem .7rem; font-size: .78rem; border-radius: 6px; }

/* ?? FORMS ?????????????????????????????????????????????????? */
.dash-form-group { margin-bottom: 1.25rem; }
.dash-label {
    display: block; font-size: .83rem; font-weight: 600;
    color: var(--dash-text-muted); margin-bottom: .4rem;
}
.dash-input {
    width: 100%;
    background: var(--dash-surface-2);
    border: 1px solid var(--dash-border);
    border-radius: 8px; color: var(--dash-text);
    padding: .6rem .9rem; font-size: .9rem; font-family: inherit;
    transition: border-color .2s;
}
.dash-input:focus {
    outline: none; border-color: var(--dash-gold);
    box-shadow: 0 0 0 3px rgba(196,151,59,.12);
}
.dash-input::placeholder { color: var(--dash-text-muted); }
select.dash-input option { background: var(--dash-surface); }
.dash-input-file {
    background: var(--dash-surface-2);
    border: 2px dashed var(--dash-border);
    border-radius: 8px; padding: 1rem;
    text-align: center; cursor: pointer;
    transition: border-color .2s;
}
.dash-input-file:hover { border-color: var(--dash-gold); }
.dash-img-preview {
    max-height: 140px; border-radius: 8px;
    border: 1px solid var(--dash-border); object-fit: cover;
    display: none;
}
.dash-field-error { color: var(--dash-danger); font-size: .78rem; margin-top: .3rem; }
.dash-check {
    display: flex; align-items: center; gap: .6rem;
    cursor: pointer; font-size: .9rem; color: var(--dash-text);
}
.dash-check input[type="checkbox"] { accent-color: var(--dash-gold); width: 16px; height: 16px; }

/* ?? SEARCH BAR ????????????????????????????????????????????? */
.dash-search-bar {
    display: flex; align-items: center;
    background: var(--dash-surface-2);
    border: 1px solid var(--dash-border); border-radius: 8px;
    overflow: hidden;
}
.dash-search-bar input {
    background: none; border: none; outline: none;
    color: var(--dash-text); padding: .5rem .9rem;
    font-family: inherit; font-size: .9rem; flex: 1;
}
.dash-search-bar button {
    background: none; border: none; padding: .5rem .8rem;
    color: var(--dash-text-muted); cursor: pointer; transition: color .2s;
}
.dash-search-bar button:hover { color: var(--dash-gold); }

/* ?? PAGINATION ????????????????????????????????????????????? */
.dash-pagination {
    display: flex; align-items: center; justify-content: center;
    gap: .4rem; padding: 1rem;
}
.dash-page-btn {
    min-width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: var(--dash-surface-2); border: 1px solid var(--dash-border);
    color: var(--dash-text-muted); font-size: .85rem; font-weight: 600;
    text-decoration: none; transition: all .2s; cursor: pointer;
}
.dash-page-btn:hover, .dash-page-btn.active {
    background: var(--dash-gold); border-color: var(--dash-gold); color: #fff;
}
.dash-page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ?? IMAGE THUMB ???????????????????????????????????????????? */
.dash-thumb {
    width: 52px; height: 52px; border-radius: 8px;
    object-fit: cover; border: 1px solid var(--dash-border);
}

/* Ensure Bootstrap tables inside dashboard cards follow dark theme */
.dash-card .table {
    background: transparent;
    color: var(--dash-text);
}
.dash-card .table thead th,
.dash-card .table thead td { 
    background: var(--dash-surface-2) !important;
    color: var(--dash-text-muted) !important;
    border-bottom: 1px solid var(--dash-border) !important;
}
.dash-card .table tbody td {
    background: transparent !important;
    color: var(--dash-text) !important;
    border-bottom: 1px solid var(--dash-border) !important;
}

/* Fix: override Bootstrap's default white background for `th` inside dashboard tables
   Some pages use `<th>` inside `tbody` for label cells; bootstrap may apply a light
   background via table variables. Force dark surface and proper text color. */
.dash-card .table th,
.dash-card .table tbody th,
.dash-card .table td {
    background-color: transparent !important;
    color: inherit !important;
}

/* Make label cells (th inside tbody) use the darker surface for contrast */
.dash-card .table tbody th {
    background: var(--dash-surface-2) !important;
    color: var(--dash-text-muted) !important;
    font-weight: 600;
}

/* Ensure Bootstrap utility `.text-muted` inside cards matches theme */
.dash-card .text-muted { color: var(--dash-text-muted) !important; }

/* helper text color inside cards */
.dash-card .text-muted { color: var(--dash-text-muted) !important; }

/* per-size palette styles */
.size-palette { display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; }
.size-palette .wc-palette-btn { width:20px; height:20px; border-radius:6px; border:1px solid rgba(255,255,255,0.06); padding:0; cursor:pointer; }
.wc-palette-btn { outline:none; }

/* Palette images preview (used on Project Create/Edit pages) */
.palette-images-preview{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top:10px;
}

.palette-images-preview img{
    width:22px;
    height:22px;
    object-fit:cover;
    border-radius:8px;
    border:1px solid #555;
    display:inline-block;
}


/* ── LOGIN PAGE ─────────────────────────────────────────────── */
.dash-login-page {
    flex: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dash-bg);
    position: relative;
    overflow: hidden;
}

/* Watermark logo in background */
.dash-login-page::before {
    content: 'WoodCorner';
    position: absolute;
    font-size: 20vw;
    font-weight: 900;
    color: rgba(196,151,59,.04);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    letter-spacing: -4px;
    transform: rotate(-20deg) translateY(-10%);
    z-index: 0;
}

/* Arabic watermark */
.dash-login-page::after {
    content: 'الركن الخشبي';
    position: absolute;
    bottom: 8%;
    font-size: 12vw;
    font-weight: 900;
    color: rgba(196,151,59,.03);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    transform: rotate(-20deg);
    z-index: 0;
}

/* Decorative corner glow */
.dash-login-page .dash-login-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.dash-login-page .dash-login-glow--top {
    width: 500px; height: 500px;
    top: -200px; left: -200px;
    background: radial-gradient(circle, rgba(196,151,59,.07) 0%, transparent 70%);
}
.dash-login-page .dash-login-glow--bottom {
    width: 400px; height: 400px;
    bottom: -150px; right: -150px;
    background: radial-gradient(circle, rgba(196,151,59,.06) 0%, transparent 70%);
}

.dash-login-card {
    width: 100%; max-width: 420px;
    background: var(--dash-surface);
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius);
    padding: 2.5rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.dash-login-logo { text-align: center; margin-bottom: 2rem; }
.dash-login-logo-ar { font-size: 1.6rem; font-weight: 800; color: var(--dash-gold); }
.dash-login-logo-en { font-size: .65rem; letter-spacing: 5px; color: var(--dash-text-muted); text-transform: uppercase; }

/* ── Tag-input for dimensions ─────────────────────────────── */
.dash-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    min-height: 32px;
}

.dash-tag {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: var(--dash-gold-dim);
    border: 1px solid rgba(196,151,59,.35);
    color: var(--dash-text);
    border-radius: 4px;
    padding: .18rem .55rem;
    font-size: .78rem;
}

.dash-tag-remove {
    background: transparent;
    border: none;
    color: var(--dash-text-muted);
    cursor: pointer;
    font-size: .9rem;
    line-height: 1;
    padding: 0;
    transition: color .15s;
}
.dash-tag-remove:hover { color: var(--dash-danger); }


/* ?? DROPDOWN ??????????????????????????????????????????????? */
.dropdown-menu {
    background: var(--dash-surface);
    border: 1px solid var(--dash-border);
    border-radius: 8px; min-width: 180px;
}
.dropdown-item { color: var(--dash-text); font-size: .88rem; padding: .5rem 1rem; }
.dropdown-item:hover { background: var(--dash-surface-2); color: var(--dash-gold); }

/* ?? ALERT ?????????????????????????????????????????????????? */
.alert { border-radius: 8px; font-size: .9rem; }
.dash-alert { padding: .7rem 1rem; border-radius: 8px; font-size: .9rem; }
.dash-alert--success { background: rgba(46,204,113,.12); color: #7dcea0; }
.dash-alert--danger { background: rgba(231,76,60,.12); color: #f1948a; }

/* ?? SCROLLBAR ?????????????????????????????????????????????? */
.dash-sidebar__nav::-webkit-scrollbar { width: 4px; }
.dash-sidebar__nav::-webkit-scrollbar-thumb { background: var(--dash-border); border-radius: 2px; }

/* ?? RESPONSIVE ????????????????????????????????????????????? */
@media (max-width: 991.98px) {
    .dash-sidebar { transform: translateX(100%); transition: transform .3s; }
    .dash-sidebar.open { transform: translateX(0); }
    .dash-main { margin-right: 0; }
    .dash-content { padding: 1rem; }
}

/* Utility */
.text-gold { color: var(--dash-gold) !important; }

/* Stat Mini Card */.dash-stat-mini{background:var(--dash-surface);border:1px solid rgba(196,151,59,.12);border-radius:10px;padding:1rem;text-align:center;}.dash-stat-mini .text-gold{font-size:1.3rem;}
