/* ================================
   LynkUp Digital Dashboard
   ================================ */

:root {
    /* LynkUp Logo palette — black + golden yellow */
    --color-accent: #fcaa3e;
    --color-accent-hover: #e89a30;
    --color-accent-light: #fef5e8;
    --color-gold: #fcaa3e;
    --color-orange: #F28C28;
    --color-navy: #1a1a1a;
    --color-navy-hover: #333333;
    --color-bg: #fafafa;
    --color-bg-hero: #f5f5f0;
    --color-bg-white: #ffffff;
    --color-heading: #1a1a1a;
    --color-text: #555555;
    --color-text-light: #888888;
    --color-border: #e8e8e8;
    --color-border-light: #f0f0f0;
    --color-sidebar: #1a1a1a;
    --color-sidebar-bar: #222222;
    --color-sidebar-hover: #2e2e2e;
    --color-sidebar-active: #fcaa3e;
    --color-success: #38a169;
    --color-warning: #F5A623;
    --color-danger: #e53e3e;
    --font-body: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-pill: 9999px;
    --shadow: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --glass-bg: rgba(255,255,255,0.92);
    --glass-border: rgba(0,0,0,0.1);
    --glass-blur: 12px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: linear-gradient(135deg, #eceae5 0%, #e4e2dc 40%, #e9e7e2 100%);
    background-attachment: fixed;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-heading);
    font-weight: 700;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-navy); }

.bg-accent { background: var(--color-accent) !important; }
.bg-gold { background: var(--color-gold) !important; }

/* --- App Layout --- */
.app-layout {
    display: flex;
    min-height: 100vh;
    padding: 16px;
    gap: 16px;
    background: var(--color-bg);
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 32px);
}

.app-content {
    flex: 1;
    padding: 24px 28px;
}

/* --- Sidebar --- */
.sidebar {
    position: sticky;
    top: 16px;
    width: var(--sidebar-width);
    height: calc(100vh - 32px);
    background: var(--color-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 200;
    border-radius: var(--radius-lg);
    flex-shrink: 0;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.sidebar__header {
    padding: 24px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar__header .sidebar__close {
    position: absolute;
    right: 12px;
    top: 20px;
}

.sidebar__logo { text-decoration: none; }

.sidebar__logo-text {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.sidebar__logo-text span {
    color: var(--color-accent);
}


.sidebar__close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px;
}

.sidebar__nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sidebar__nav::-webkit-scrollbar {
    display: none;
}

.sidebar__section {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    padding: 20px 12px 6px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.sidebar__link::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.4s ease;
}

.sidebar__link:hover::before {
    left: 100%;
}

.sidebar__link:hover {
    color: #fff;
    background: var(--color-sidebar-hover);
}

.sidebar__link--active {
    color: #fff;
    background: var(--color-sidebar-active);
}

.sidebar__link--active:hover {
    background: var(--color-accent-hover);
}

.sidebar__link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar__footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar__link--logout { color: rgba(255,255,255,0.45); }
.sidebar__link--logout:hover { color: #ff8a80; background: rgba(255,0,0,0.08); }

/* --- Topbar (Glass) --- */
.topbar {
    height: var(--topbar-height);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    padding: 0 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 100;
}

.topbar__toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-heading);
    cursor: pointer;
    padding: 4px 8px;
    margin-right: 8px;
}

.topbar__spacer { flex: 1; }

.topbar__user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar__user-dropdown {
    position: relative;
    z-index: 1000;
}

.topbar__user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-heading);
    transition: background 0.15s ease;
}

.topbar__user-btn:hover {
    background: rgba(0,0,0,0.04);
}

.topbar__user-btn i:first-child {
    font-size: 1.3rem;
    color: var(--color-text-light);
}

.topbar__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--color-bg-white);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    min-width: 160px;
    padding: 6px;
    z-index: 300;
    animation: fadeInUp 0.15s ease-out;
}

.topbar__dropdown.show {
    display: block;
}

.topbar__dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    transition: background 0.15s ease;
}

.topbar__dropdown-item:hover {
    background: rgba(0,0,0,0.04);
    color: var(--color-heading);
}

.topbar__dropdown-item--danger:hover {
    background: #fef2f2;
    color: #e53e3e;
}

/* --- Logo --- */
.logo-text {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: #fff;
}

.logo-accent {
    color: var(--color-accent);
}

/* --- Auth Pages --- */
.auth-page {
    background: linear-gradient(135deg, #eceae5 0%, #e4e2dc 40%, #e9e7e2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-wrapper {
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.4s ease-out;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-text {
    color: var(--color-heading);
    font-size: 1.5rem;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.4rem;
}

.auth-card .auth-subtitle {
    text-align: center;
    color: var(--color-text-light);
    margin-bottom: 28px;
    font-size: 0.9rem;
}

/* --- Cards (Glass) --- */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: rgba(255,255,255,0.3);
    border-bottom: 1px solid var(--glass-border);
    padding: 18px 22px;
    font-weight: 600;
    color: var(--color-heading);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-body { padding: 22px; }

/* --- Stat Cards (Glass) --- */
.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card__label {
    font-size: 0.8rem;
    color: var(--color-text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-card__value {
    font-family: var(--font-body);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-top: 4px;
}

.stat-card__icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* --- Page Header --- */
.page-header {
    margin-bottom: 24px;
}

.page-header__title {
    font-size: 1.5rem;
    margin: 0;
}

.page-header__subtitle {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* --- Buttons --- */
/* Primary button — golden gradient */
.btn-coral {
    background: linear-gradient(135deg, #fcaa3e 0%, #e89a30 100%);
    color: #fff;
    border: none;
    font-weight: 600;
    padding: 11px 26px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-coral::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-coral:hover::before {
    left: 100%;
}

.btn-coral:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(252, 170, 62, 0.35);
}

.btn-coral:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(252, 170, 62, 0.2);
}

/* Large variant */
.btn-coral.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
    border-radius: 14px;
}

/* Outline button — glass style */
.btn-coral-outline {
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--color-heading);
    border: 1.5px solid var(--color-border);
    font-weight: 600;
    padding: 11px 26px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.btn-coral-outline:hover {
    background: var(--color-heading);
    border-color: var(--color-heading);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Dark button — for secondary actions */
.btn-dark {
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    color: #fff;
    border: none;
    font-weight: 600;
    padding: 11px 26px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-dark::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.btn-dark:hover::before {
    left: 100%;
}

.btn-dark:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.btn-dark:active {
    transform: translateY(0);
}

/* --- Forms --- */
.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-heading);
    margin-bottom: 6px;
}

.form-control, .form-select {
    border: 1.5px solid var(--color-border);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: var(--font-body);
    transition: border-color 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(252, 170, 62, 0.15);
}

.form-hint {
    font-size: 0.78rem;
    color: var(--color-text-light);
    margin-top: 4px;
}

/* --- Tables --- */
.table {
    font-size: 0.88rem;
}

.table th {
    font-weight: 600;
    color: var(--color-heading);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom-width: 2px;
}

.table td {
    vertical-align: middle;
}

/* --- Quick Action Cards --- */
.quick-action {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    text-align: center;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
}

.quick-action::before {
    content: '';
    position: absolute;
    top: 0; left: -120%;
    width: 80%; height: 100%;
    background: linear-gradient(
        105deg,
        transparent 20%,
        rgba(255,255,255,0.1) 30%,
        rgba(255,255,255,0.7) 50%,
        rgba(255,255,255,0.1) 70%,
        transparent 80%
    );
    transform: skewX(-25deg);
    pointer-events: none;
    transition: none;
}

.quick-action:hover::before {
    animation: cardShine 0.8s ease forwards;
}

@keyframes cardShine {
    0% { left: -120%; }
    100% { left: 150%; }
}

.quick-action::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(252,170,62,0.2), transparent 40%, transparent 60%, rgba(252,170,62,0.15));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.quick-action:hover::after {
    opacity: 1;
}

.quick-action:hover {
    border-color: rgba(252,170,62,0.4);
    box-shadow:
        0 12px 40px rgba(252,170,62,0.18),
        0 4px 16px rgba(0,0,0,0.06),
        inset 0 1px 0 rgba(255,255,255,0.6);
    transform: translateY(-5px) scale(1.02);
}

.quick-action:active {
    transform: translateY(-1px) scale(0.99);
    transition-duration: 0.1s;
}

.quick-action__icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.quick-action__title {
    font-weight: 600;
    color: var(--color-heading);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.quick-action__desc {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

/* --- Order Summary --- */
.order-summary {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    padding: 20px;
}

.order-summary__row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
}

.order-summary__total {
    border-top: 2px solid var(--color-accent);
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-heading);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--color-text-light);
}

.empty-state__icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state__text {
    font-size: 0.95rem;
    margin-bottom: 16px;
}

/* --- Alerts --- */
.alert { border-radius: 14px; font-size: 0.9rem; }

/* --- Tab Nav --- */
.nav-tabs .nav-link {
    color: var(--color-text-light);
    font-weight: 600;
    font-size: 0.88rem;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
}

.nav-tabs .nav-link.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    background: none;
}

.nav-tabs .nav-link:hover {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* --- Custom Grade Dropdown --- */
.grade-dropdown {
    position: relative;
}

.grade-dropdown__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 6px 12px;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--font-body);
    color: var(--color-text-light);
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 34px;
}

.grade-dropdown__trigger:hover {
    border-color: var(--color-accent);
}

.grade-dropdown__trigger.has-value {
    color: var(--color-heading);
    font-weight: 600;
}

.grade-dropdown__trigger .chevron {
    font-size: 0.6rem;
    opacity: 0.5;
    transition: transform 0.2s;
}

.grade-dropdown.open .chevron {
    transform: rotate(180deg);
}

.grade-dropdown__menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 500;
    padding: 4px;
    width: 280px;
}

/* Allow grade dropdown to overflow table */
#links-table td:first-child { overflow: visible; position: relative; }
#order-form .table-responsive { overflow: visible; }
#order-form .card-body { overflow: visible; }

.grade-dropdown.open .grade-dropdown__menu {
    display: block;
    animation: fadeInUp 0.12s ease-out;
}

.grade-dropdown__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 0.85rem;
}

.grade-dropdown__option:hover {
    background: var(--color-accent-light);
}

.grade-dropdown__option.selected {
    background: var(--color-accent-light);
    font-weight: 600;
}

.grade-dropdown__option-name {
    color: var(--color-heading);
    font-weight: 600;
}

.grade-dropdown__option-price {
    color: var(--color-accent);
    font-weight: 700;
    font-size: 0.85rem;
}

.grade-dropdown__option-meta {
    font-size: 0.72rem;
    color: var(--color-text-light);
    margin-left: 6px;
}

/* --- Mobile --- */
@media (max-width: 991.98px) {
    .app-layout {
        padding: 0;
        gap: 0;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        border-radius: 0;
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .app-main {
        min-height: 100vh;
    }

    .app-content {
        padding: 16px;
    }

    .topbar {
        padding: 0 16px;
        border-radius: 0;
        margin-bottom: 0;
    }
}

/* --- Sidebar overlay (mobile) --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
}

.sidebar-overlay.show {
    display: block;
}

/* --- Admin Portal --- */
/* Same theme as customer — no overrides needed */

/* ================================
   Animations & Interactions
   ================================ */

/* Page content fade-in on load */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-content {
    animation: fadeInUp 0.35s ease-out;
}

/* (button animations defined in button section above) */

/* Quick action transition handled above */

/* Table row hover */
.table tbody tr {
    transition: background 0.15s ease;
}

/* Sidebar link transition */
.sidebar__link {
    transition: all 0.15s ease;
}

/* Badge pulse on status */
.badge {
    transition: transform 0.15s ease;
}

.badge:hover {
    transform: scale(1.05);
}

/* Smooth form input focus */
.form-control, .form-select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Stat card icon subtle bounce on hover */
.stat-card:hover .stat-card__icon {
    animation: iconBounce 0.4s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Staggered fade-in for dashboard cards */
.row > [class*="col-"]:nth-child(1) { animation-delay: 0s; }
.row > [class*="col-"]:nth-child(2) { animation-delay: 0.05s; }
.row > [class*="col-"]:nth-child(3) { animation-delay: 0.1s; }
.row > [class*="col-"]:nth-child(4) { animation-delay: 0.15s; }

.row > [class*="col-"] {
    animation: fadeInUp 0.35s ease-out both;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

