/* ============================================================
   Customer Dashboard — Main Stylesheet
   Color scheme: Yellow Pages (#ffe600) + Black
   ============================================================ */

/* ---- CSS Custom Properties -------------------------------- */
:root {
    --yellow:        #ffe600;
    --yellow-hover:  #e6cf00;
    --yellow-dark:   #b8a400;
    --black:         #0a0a0a;
    --black-soft:    #1a1a1a;
    --black-mid:     #2c2c2c;
    --white:         #ffffff;
    --grey-100:      #f7f7f7;
    --grey-200:      #ebebeb;
    --grey-400:      #aaaaaa;
    --grey-600:      #666666;

    --success:       #1a7a3c;
    --success-bg:    #d6f0e0;
    --error:         #c0392b;
    --error-bg:      #fde8e6;
    --warning:       #856404;
    --warning-bg:    #fff3cd;
    --info:          #0c5460;
    --info-bg:       #d1ecf1;

    --font-display:  'Space Grotesk', 'Segoe UI', sans-serif;
    --font-body:     'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-mono:     'Courier New', monospace;

    --radius-sm:     4px;
    --radius:        8px;
    --radius-lg:     12px;

    --shadow-sm:     0 1px 3px rgba(0,0,0,0.12);
    --shadow:        0 4px 12px rgba(0,0,0,0.10);
    --shadow-lg:     0 8px 28px rgba(0,0,0,0.15);

    --header-height: 68px;
    --transition:    0.18s ease;
}

/* ---- Reset ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--grey-100);
    color: var(--black);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---- Typography ------------------------------------------- */
h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
}
h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 2.5vw, 1.9rem); }
h3 { font-size: 1.25rem; }

/* ---- Site Header ------------------------------------------ */
.site-header {
    background: var(--black);
    color: var(--yellow);
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.logo-link { display: flex; align-items: center; flex-shrink: 0; }
.logo-img   { height: 44px; width: auto; }

/* ---- Navigation ------------------------------------------ */
.main-nav { flex: 1; }
.nav-list {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}
.nav-link {
    display: block;
    padding: 0.45rem 1rem;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--yellow);
    border-radius: var(--radius-sm);
    letter-spacing: 0.02em;
    transition: background var(--transition), color var(--transition);
}
.nav-link:hover          { background: rgba(255,230,0,0.15); }
.nav-link--active        { background: var(--yellow); color: var(--black); }
.nav-link--active:hover  { background: var(--yellow-hover); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--yellow);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

/* Header user zone */
.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-left: auto;
}
.header-user__name {
    font-size: 0.85rem;
    color: var(--grey-400);
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Main Content ----------------------------------------- */
.site-main {
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

/* ---- Site Footer ------------------------------------------ */
.site-footer {
    background: var(--black);
    color: var(--yellow);
    padding: 1rem 1.5rem;
    margin-top: auto;
}
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0.75;
}

/* ---- Buttons ---------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: background var(--transition), color var(--transition),
                border-color var(--transition), transform var(--transition);
    text-align: center;
    white-space: nowrap;
    line-height: 1.2;
    text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn--primary {
    background: var(--yellow);
    color: var(--black);
    border-color: var(--yellow);
}
.btn--primary:hover { background: var(--yellow-hover); border-color: var(--yellow-hover); }

.btn--black {
    background: var(--black);
    color: var(--yellow);
    border-color: var(--black);
}
.btn--black:hover { background: var(--black-mid); border-color: var(--black-mid); }

.btn--outline {
    background: transparent;
    color: var(--black);
    border-color: var(--black);
}
.btn--outline:hover { background: var(--black); color: var(--yellow); }

.btn--outline-yellow {
    background: transparent;
    color: var(--yellow);
    border-color: var(--yellow);
}
.btn--outline-yellow:hover { background: var(--yellow); color: var(--black); }

.btn--danger {
    background: var(--error);
    color: var(--white);
    border-color: var(--error);
}
.btn--danger:hover { background: #a93226; border-color: #a93226; }

.btn--sm  { padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.btn--lg  { padding: 0.8rem 1.75rem;  font-size: 1rem; }
.btn--full { width: 100%; justify-content: center; }

/* ---- Cards ------------------------------------------------ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card__header {
    background: var(--black);
    color: var(--yellow);
    padding: 1.1rem 1.5rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.card__body { padding: 1.5rem; }
.card__footer {
    padding: 1rem 1.5rem;
    background: var(--grey-100);
    border-top: 1px solid var(--grey-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ---- Forms ------------------------------------------------ */
.form-group {
    margin-bottom: 1.25rem;
}
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--black-soft);
}
.form-label .required { color: var(--error); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--black);
    background: var(--white);
    border: 2px solid var(--grey-200);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    appearance: none;
}
.form-control:focus {
    border-color: var(--yellow-dark);
    box-shadow: 0 0 0 3px rgba(255,230,0,0.25);
}
.form-control:disabled { background: var(--grey-100); cursor: not-allowed; opacity: 0.7; }
.form-control.is-invalid { border-color: var(--error); }
.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(192,57,43,0.18);
}

.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%230a0a0a' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.85rem center; padding-right: 2.5rem; }

.form-hint {
    font-size: 0.78rem;
    color: var(--grey-600);
    margin-top: 0.3rem;
}
.form-error {
    font-size: 0.78rem;
    color: var(--error);
    margin-top: 0.3rem;
}

.password-wrapper {
    position: relative;
}
.password-wrapper .form-control { padding-right: 3rem; }
.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--grey-600);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.2rem;
}
.password-toggle:hover { color: var(--black); }

.password-strength { margin-top: 0.5rem; }
.password-strength__bar {
    height: 4px;
    border-radius: 2px;
    background: var(--grey-200);
    overflow: hidden;
}
.password-strength__fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}
.password-strength__label {
    font-size: 0.72rem;
    margin-top: 0.25rem;
    color: var(--grey-600);
}

/* ---- Alerts / Flash --------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid transparent;
}
.alert--success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.alert--error   { background: var(--error-bg);   color: var(--error);   border-color: var(--error); }
.alert--warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.alert--info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info); }
.alert__close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.6;
    color: inherit;
    flex-shrink: 0;
    padding: 0;
}
.alert__close:hover { opacity: 1; }

/* ---- Tables ----------------------------------------------- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table thead { background: var(--black); color: var(--yellow); }
.data-table thead th {
    padding: 0.8rem 1rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}
.data-table tbody tr { border-bottom: 1px solid var(--grey-200); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,230,0,0.06); }
.data-table td {
    padding: 0.8rem 1rem;
    vertical-align: middle;
}
.data-table .actions { display: flex; gap: 0.5rem; }

/* ---- Badges ----------------------------------------------- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge--active  { background: var(--success-bg); color: var(--success); }
.badge--inactive { background: var(--grey-200); color: var(--grey-600); }
.badge--admin   { background: var(--black); color: var(--yellow); }
.badge--user    { background: var(--grey-200); color: var(--black); }

/* ---- Page Title ------------------------------------------- */
.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}
.page-title h1 { color: var(--black); }

/* ---- Modal / Dialog --------------------------------------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.is-open { display: flex; }
.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity:0; transform: scale(0.94) translateY(-12px); }
    to   { opacity:1; transform: scale(1)    translateY(0); }
}
.modal__header {
    background: var(--black);
    color: var(--yellow);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-display);
    font-weight: 700;
}
.modal__close {
    background: none;
    border: none;
    color: var(--yellow);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
}
.modal__close:hover { opacity: 1; }
.modal__body   { padding: 1.5rem; }
.modal__footer {
    padding: 1rem 1.5rem;
    background: var(--grey-100);
    border-top: 1px solid var(--grey-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ---- Welcome / Home --------------------------------------- */
.welcome-hero {
    background: var(--black);
    color: var(--yellow);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
.welcome-hero::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 260px; height: 260px;
    border-radius: 50%;
    background: rgba(255,230,0,0.08);
    pointer-events: none;
}
.welcome-hero::after {
    content: '';
    position: absolute;
    bottom: -80px; left: -40px;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(255,230,0,0.05);
    pointer-events: none;
}
.welcome-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 0.75rem; }
.welcome-hero p  { font-size: 1.05rem; opacity: 0.8; max-width: 540px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    border-left: 5px solid var(--yellow);
}
.stat-card__label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--grey-600); font-weight: 600; }
.stat-card__value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; margin-top: 0.25rem; }

/* ---- Login page ------------------------------------------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--black);
}
.login-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}
.login-card__header {
    background: var(--black);
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    border-bottom: 4px solid var(--yellow);
}
.login-card__header img { height: 52px; margin: 0 auto 1rem; }
.login-card__header h1 {
    font-size: 1.2rem;
    color: var(--yellow);
    font-family: var(--font-display);
    font-weight: 700;
}
.login-card__body { padding: 2rem; }
.login-card__footer {
    padding: 0.75rem 2rem 1.5rem;
    text-align: center;
    font-size: 0.85rem;
}
.login-link { color: var(--black); font-weight: 600; border-bottom: 2px solid var(--yellow); }
.login-link:hover { color: var(--grey-600); }

.login-footer {
    background: var(--black-soft);
    color: rgba(255,255,255,0.3);
    text-align: center;
    padding: 0.75rem;
    font-size: 0.75rem;
}

/* ---- Search bar ------------------------------------------ */
.search-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.25rem;
}
.search-bar .form-control { max-width: 320px; }

/* ---- Utilities -------------------------------------------- */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--grey-600); }
.text-sm      { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.gap-2  { gap: 0.75rem; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }

/* ---- Responsive ------------------------------------------- */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        left: 0; right: 0;
        background: var(--black-soft);
        padding: 1rem;
        gap: 0.25rem;
        box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    }
    .nav-list.is-open { display: flex; }
    .site-header { position: relative; }
    .main-nav { position: static; }
    .header-user__name { display: none; }
    .page-title { flex-direction: column; align-items: flex-start; }
    .data-table thead { display: none; }
    .data-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--grey-200);
        border-radius: var(--radius);
    }
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--grey-200);
    }
    .data-table td:last-child { border-bottom: none; }
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--grey-600);
    }
    .data-table .actions { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
