/* ═══════════════════════════════════════════════════════════
   ChatBot Gold — Premium Design System
   Colors: Green (#059669) + White
   Direction: RTL (Arabic)
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ───────────────────────────────────────── */
:root {
    --primary:     #059669;
    --primary-50:  #ecfdf5;
    --primary-100: #d1fae5;
    --primary-200: #a7f3d0;
    --primary-300: #6ee7b7;
    --primary-400: #34d399;
    --primary-500: #10b981;
    --primary-600: #059669;
    --primary-700: #047857;
    --primary-800: #065f46;
    --primary-900: #064e3b;

    --gold:       #c9a96e;
    --gold-light: #f5e6d3;

    --white:    #ffffff;
    --gray-50:  #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    --radius-sm: 10px;
    --radius:    16px;
    --radius-lg: 20px;
    --radius-xl: 24px;

    --shadow-sm:  0 1px 2px rgba(0,0,0,.05);
    --shadow:     0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
    --shadow-md:  0 6px 16px -3px rgba(0,0,0,.1), 0 3px 6px -4px rgba(0,0,0,.06);
    --shadow-lg:  0 12px 28px -5px rgba(0,0,0,.12), 0 5px 10px -6px rgba(0,0,0,.07);
    --shadow-xl:  0 20px 40px -8px rgba(0,0,0,.15);

    --transition: .25s cubic-bezier(.4,0,.2,1);
    --transition-slow: .55s cubic-bezier(.4,0,.2,1);
}

/* ── Dark Mode Variables ────────────────────────────────── */
[data-theme="dark"] {
    --white:    #0f172a;
    --gray-50:  #1e293b;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #94a3b8;
    --gray-500: #cbd5e1;
    --gray-600: #e2e8f0;
    --gray-700: #f1f5f9;
    --gray-800: #f8fafc;
    --gray-900: #ffffff;

    --shadow-sm:  0 1px 2px rgba(0,0,0,.2);
    --shadow:     0 4px 6px -1px rgba(0,0,0,.3), 0 2px 4px -2px rgba(0,0,0,.2);
    --shadow-md:  0 6px 16px -3px rgba(0,0,0,.4), 0 3px 6px -4px rgba(0,0,0,.25);
    --shadow-lg:  0 12px 28px -5px rgba(0,0,0,.5), 0 5px 10px -6px rgba(0,0,0,.3);
    --shadow-xl:  0 20px 40px -8px rgba(0,0,0,.6);

    color-scheme: dark;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; scroll-behavior: smooth; }

body {
    font-family: 'Cairo', 'Segoe UI', system-ui, -apple-system, sans-serif;
    direction: rtl;
    text-align: right;
    background: var(--white);
    color: var(--gray-800);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior: none;
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea { font-family: inherit; }

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════ */

.login-body {
    background: linear-gradient(160deg, var(--white) 0%, var(--primary-50) 40%, var(--white) 100%);
    min-height: 100vh;
}

/* ── Screens (shared structure for transitions) ──────────── */
.screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: scale(.96);
    transition: opacity var(--transition-slow), transform var(--transition-slow), visibility 0s linear .55s;
    pointer-events: none;
    overflow-y: auto;
    z-index: 1;
}
.screen.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    pointer-events: auto;
    transition: opacity var(--transition-slow), transform var(--transition-slow);
    z-index: 2;
}

/* ── Aurora Blobs ────────────────────────────────────────── */
.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .35;
    pointer-events: none;
    z-index: 0;
}
.blob-1 {
    width: 420px; height: 420px;
    background: var(--primary-200);
    top: -60px; right: -120px;
    animation: blobFloat 8s ease-in-out infinite alternate;
}
.blob-2 {
    width: 350px; height: 350px;
    background: var(--primary-300);
    bottom: 10%; left: -100px;
    animation: blobFloat 10s ease-in-out infinite alternate-reverse;
}
.blob-3 {
    width: 200px; height: 200px;
    background: var(--primary-100);
    top: 40%; left: 30%;
    animation: blobFloat 12s ease-in-out infinite alternate;
}

@keyframes blobFloat {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -20px) scale(1.08); }
}

/* ── Login Container ─────────────────────────────────────── */
.login-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 16px;
    position: relative;
    z-index: 10;
}
.login-card {
    width: 100%;
    max-width: 420px;
}
.login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.login-logo img, .login-logo svg {
    height: 56px;
}
.login-logo .brand-text {
    font-size: 28px;
    font-weight: 900;
    color: var(--primary-700);
    letter-spacing: -.5px;
}
.login-logo .brand-text span {
    color: var(--gold);
}
.login-title {
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 4px;
    color: var(--gray-900);
}
.login-subtitle {
    font-size: 13px;
    color: var(--gray-500);
    text-align: center;
    margin-bottom: 28px;
}

/* ── Form Fields ─────────────────────────────────────────── */
.field-group {
    margin-bottom: 18px;
}
.field-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.field-wrap {
    position: relative;
}
.field-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    color: var(--gray-400);
    pointer-events: none;
}
.field-input {
    width: 100%;
    padding: 13px 44px 13px 14px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 15px;
    color: var(--gray-800);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.field-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5,150,105,.15);
}
.field-input::placeholder {
    color: var(--gray-400);
    font-size: 14px;
}
.field-input[dir="ltr"] {
    text-align: left;
    padding: 13px 14px 13px 44px;
}
.field-input[dir="ltr"] ~ .field-icon {
    right: auto;
    left: 14px;
}
.pw-toggle {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    padding: 4px;
    transition: color var(--transition);
}
.pw-toggle:hover { color: var(--gray-600); }

/* ── Checkbox + Links Row ────────────────────────────────── */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--gray-600);
}
.check-label input[type="checkbox"] {
    width: 17px; height: 17px;
    border-radius: 4px;
    accent-color: var(--primary);
}
.forgot-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    color: var(--white);
    font-size: 15px;
    font-weight: 700;
    border: 1px solid var(--primary-700);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition);
    box-shadow: 0 4px 14px rgba(5,150,105,.2);
    position: relative;
    overflow: hidden;
}
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,.15));
    opacity: 0;
    transition: opacity var(--transition);
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(5,150,105,.3);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(5,150,105,.15);
}
.btn-primary:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}
.btn-primary i { width: 18px; height: 18px; }

.btn-ghost {
    width: 100%;
    padding: 10px;
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    transition: color var(--transition);
}
.btn-ghost:hover { color: var(--primary); }
.btn-ghost i { width: 15px; height: 15px; }

/* ── Alert Box ───────────────────────────────────────────── */
.alert-box {
    display: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
    animation: alertSlide .3s ease;
}
.alert-box.show { display: block; }
.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.alert-success {
    background: var(--primary-50);
    color: var(--primary-700);
    border: 1px solid var(--primary-200);
}
@keyframes alertSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── OTP Boxes ───────────────────────────────────────────── */
.otp-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    direction: ltr;
    margin-bottom: 22px;
}
.otp-box {
    width: 48px;
    height: 56px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    outline: none;
    transition: all .2s ease;
    background: var(--white);
}
.otp-box:focus, .otp-box.filled {
    border-color: var(--primary);
    background: var(--primary-50);
    box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}
.otp-email-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 24px;
}
.otp-email-display i { width: 16px; height: 16px; color: var(--gray-500); }

/* ── Loading Screen ──────────────────────────────────────── */
.loader-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    position: relative;
    z-index: 10;
}
.loader-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 32px rgba(5,150,105,.3);
    animation: logoPulse 2s ease-in-out infinite;
}
.loader-logo i { width: 40px; height: 40px; color: var(--white); }

@keyframes logoPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 12px 32px rgba(5,150,105,.3); }
    50%      { transform: scale(1.06); box-shadow: 0 16px 40px rgba(5,150,105,.4); }
}

.loader-dots {
    display: flex;
    gap: 10px;
}
.loader-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    animation: dotBounce 1.2s ease-in-out infinite;
}
.loader-dots span:nth-child(2) { animation-delay: .15s; }
.loader-dots span:nth-child(3) { animation-delay: .3s; }

@keyframes dotBounce {
    0%, 100% { opacity: .25; transform: translateY(0); }
    50%      { opacity: 1;   transform: translateY(-6px); }
}

/* ── Account Select ──────────────────────────────────────── */
.account-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.acc-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    cursor: pointer;
    transition: all .2s ease;
    text-align: start;
}
.acc-card:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
    box-shadow: var(--shadow);
}
.acc-card:hover .acc-arrow {
    transform: translateX(-4px);
    color: var(--primary);
}
.acc-avatar {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    flex-shrink: 0;
}
.acc-info { flex: 1; }
.acc-name {
    font-weight: 800;
    font-size: 14px;
    color: var(--gray-800);
}
.acc-role {
    font-size: 11px;
    font-weight: 700;
}
.acc-role.admin { color: #8b6fd6; }
.acc-role.agent { color: var(--primary); }
.acc-arrow {
    width: 20px; height: 20px;
    color: var(--gray-300);
    transition: all .2s ease;
}

/* ── Token Modal ─────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15,23,42,.55);
    backdrop-filter: blur(8px);
}
.modal-overlay.show {
    display: flex;
}
.modal-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 440px;
    width: 100%;
    padding: 28px;
    position: relative;
    animation: modalIn .25s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(.95); }
    to   { opacity: 1; transform: scale(1); }
}
.modal-close {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px;
    border-radius: 8px;
    color: var(--gray-400);
    transition: all var(--transition);
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-600); }
.modal-close i { width: 20px; height: 20px; }
.modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}
.modal-icon {
    width: 46px; height: 46px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary-500), var(--primary-800));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.modal-icon i { width: 22px; height: 22px; color: var(--white); }
.modal-title { font-size: 16px; font-weight: 800; }
.modal-desc { font-size: 12px; color: var(--gray-500); }

.token-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: 'Courier New', monospace;
    resize: none;
    outline: none;
    transition: border-color var(--transition);
    margin-bottom: 16px;
    -webkit-text-security: disc;
}
.token-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}
.modal-actions {
    display: flex;
    gap: 10px;
}
.btn-outline {
    flex: 1;
    padding: 11px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    transition: all var(--transition);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-modal-primary {
    flex: 1;
    padding: 11px 16px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    border: none;
    transition: all var(--transition);
}
.btn-modal-primary:hover { background: var(--primary-700); }

/* ── Login Footer ────────────────────────────────────────── */
.login-footer {
    position: relative;
    z-index: 10;
    padding: 16px;
    text-align: center;
    font-size: 11px;
    color: var(--gray-400);
    flex-shrink: 0;
}
.login-footer code {
    font-family: 'Courier New', monospace;
    font-size: 10px;
}


/* ═══════════════════════════════════════════════════════════
   DASHBOARD PAGE
   ═══════════════════════════════════════════════════════════ */

.dashboard-body {
    background: linear-gradient(180deg, var(--primary-50) 0%, var(--gray-50) 30%, var(--white) 100%);
    min-height: 100vh;
}

/* ── Top Header ──────────────────────────────────────────── */
.top-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,.82);
    backdrop-filter: blur(16px) saturate(1.8);
    -webkit-backdrop-filter: blur(16px) saturate(1.8);
    border-bottom: 1px solid rgba(226,232,240,.6);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: box-shadow var(--transition);
}
.top-header.scrolled {
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.header-logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(5,150,105,.25);
}
.header-logo-icon i { width: 20px; height: 20px; color: var(--white); }
.header-brand {
    font-size: 18px;
    font-weight: 900;
    color: var(--primary-800);
    letter-spacing: -.3px;
}
.header-brand em {
    font-style: normal;
    color: var(--gold);
}

.header-center {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: 12px;
}
.tab-btn {
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition);
    white-space: nowrap;
}
.tab-btn:hover { color: var(--gray-700); }
.tab-btn.active {
    background: var(--white);
    color: var(--primary-700);
    box-shadow: var(--shadow-sm);
}
.tab-btn i { width: 16px; height: 16px; }

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-menu {
    position: relative;
}
.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 8px;
    border-radius: 12px;
    transition: background var(--transition);
}
.user-btn:hover { background: var(--gray-100); }
.user-avatar {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}
.user-avatar.green { background: var(--primary-100); color: var(--primary-700); }
.user-avatar img {
    width: 100%; height: 100%;
    border-radius: 10px;
    object-fit: cover;
}
.user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
}
.user-role {
    font-size: 10px;
    color: var(--gray-400);
}
.user-chevron { width: 16px; height: 16px; color: var(--gray-400); }

/* ── User Dropdown ───────────────────────────────────────── */
.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 6px;
    z-index: 60;
    animation: dropIn .2s ease;
}
.user-dropdown.show { display: block; }
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    width: 100%;
    text-align: start;
    transition: all var(--transition);
}
.dropdown-item:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}
.dropdown-item.danger:hover {
    background: #fef2f2;
    color: #dc2626;
}
.dropdown-item i { width: 18px; height: 18px; }
.dropdown-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 4px 0;
}

/* ── Main Content ────────────────────────────────────────── */
.main-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 36px 24px 60px;
}

/* ── Welcome Section ─────────────────────────────────────── */
.welcome-section {
    margin-bottom: 36px;
}
.welcome-greeting {
    font-size: 28px;
    font-weight: 900;
    color: var(--gray-900);
    margin-bottom: 4px;
}
.welcome-greeting .user-highlight {
    color: var(--primary);
}
.welcome-desc {
    font-size: 14px;
    color: var(--gray-500);
}

/* ── Section Headers ─────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}
.section-header i {
    width: 18px; height: 18px;
    color: var(--primary);
}
.section-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--gray-800);
}
.section-badge {
    background: var(--primary-50);
    color: var(--primary-700);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

/* ── App Cards Grid ──────────────────────────────────────── */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 36px;
}

.app-card {
    position: relative;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 22px 16px 18px;
    text-align: center;
    cursor: pointer;
    transition: all .25s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.app-card:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.app-card:active {
    transform: translateY(-1px);
}

.app-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .25s ease;
}
.app-card:hover .app-icon-wrap {
    transform: scale(1.08);
}
.app-icon-wrap i {
    width: 26px;
    height: 26px;
}

.app-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.3;
}

/* Pin button on card */
.pin-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-300);
    opacity: 0;
    transition: all .2s ease;
    z-index: 5;
}
.app-card:hover .pin-btn { opacity: 1; }
.pin-btn:hover { background: var(--gray-100); color: var(--primary); }
.pin-btn.pinned { color: var(--gold); opacity: 1; }
.pin-btn i { width: 14px; height: 14px; }

/* ── Store Tab ───────────────────────────────────────────── */
.tab-content { display: none; }
.tab-content.active { display: block; }

.store-banner {
    background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 28px;
    color: var(--white);
    position: relative;
    overflow: hidden;
}
.store-banner::before {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
    top: -100px; left: -80px;
}
.store-banner::after {
    content: '';
    position: absolute;
    width: 200px; height: 200px;
    background: rgba(255,255,255,.03);
    border-radius: 50%;
    bottom: -60px; right: -40px;
}
.store-title {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}
.store-desc {
    font-size: 14px;
    opacity: .8;
    position: relative;
    z-index: 1;
}

/* Store category label */
.store-category {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-50);
    padding: 3px 10px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 4px;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.store-card {
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: all .25s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.store-card:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
}
.store-card .app-icon-wrap {
    width: 48px; height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
}
.store-card .app-icon-wrap i { width: 24px; height: 24px; }
.store-card-info { flex: 1; }

/* ── Store Card V2 (with images) ─────────────────────────── */
.store-card-v2 {
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all .3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.store-card-v2:hover {
    border-color: var(--primary-300);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}
.store-card-img {
    width: 100%;
    height: 160px;
    overflow: hidden;
    position: relative;
}
.store-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.store-card-v2:hover .store-card-img img {
    transform: scale(1.05);
}
.store-card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50) !important;
}
.store-placeholder-icon {
    width: 56px; height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: .4;
}
.store-placeholder-icon i { width: 40px; height: 40px; }
.store-card-body {
    padding: 16px;
    flex: 1;
}
.store-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.store-card-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.store-card-icon i { width: 18px; height: 18px; }
.store-card-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: 2px;
}
.store-card-desc {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.6;
}

/* ── Dashboard Footer ────────────────────────────────────── */
.dashboard-footer {
    text-align: center;
    padding: 20px;
    font-size: 11px;
    color: var(--gray-400);
    border-top: 1px solid var(--gray-100);
    margin-top: 40px;
}
.dashboard-footer code {
    font-family: 'Courier New', monospace;
    font-size: 10px;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .top-header { padding: 0 14px; height: 56px; }
    .header-brand { display: none; }
    .tab-btn span { display: none; }
    .user-name, .user-role { display: none; }
    .main-content { padding: 24px 14px 40px; }
    .welcome-greeting { font-size: 22px; }
    .apps-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .store-grid { grid-template-columns: 1fr; }
    .app-card { padding: 18px 12px 14px; }
    .app-icon-wrap { width: 44px; height: 44px; }
    .app-icon-wrap i { width: 22px; height: 22px; }
    .app-name { font-size: 12px; }
    .login-card { max-width: 100%; }
    .otp-box { width: 42px; height: 50px; font-size: 20px; }
}

@media (max-width: 480px) {
    .apps-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .app-card { padding: 14px 8px 12px; }
    .app-icon-wrap { width: 40px; height: 40px; border-radius: 12px; }
    .app-icon-wrap i { width: 20px; height: 20px; }
    .app-name { font-size: 11px; }
    .header-center { gap: 2px; padding: 3px; }
    .tab-btn { padding: 6px 12px; font-size: 12px; }
}

/* ── Utility ─────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }
