/* ============================================================
   TableTap — Admin / Owner Dashboard Stylesheet
   ============================================================ */

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

html, body {
    margin: 0;
    padding: 0;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1a1a1a;
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* ============================================================
   1. Navbar
   ============================================================ */
.dash-nav {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.dash-nav-container {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.45rem;
    font-weight: 700;
    color: #111111;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: inline-block;
}

.logo span {
    color: #27ae60;
}

.nav-user-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-greeting {
    font-size: 0.92rem;
    color: #4b5563;
    font-weight: 500;
}

.user-greeting strong {
    color: #111111;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.btn-logout:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

/* ============================================================
   2. Dashboard Main Content Wrapper
   ============================================================ */
.dash-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 30px 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ============================================================
   3. Café Profile Hero Card
   ============================================================ */
.cafe-hero-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.cafe-profile-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cafe-logo {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f3f4f6;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    background-color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.cafe-info {
    display: flex;
    flex-direction: column;
}

.cafe-name {
    margin: 0 0 4px;
    font-size: 1.6rem;
    font-weight: 700;
    color: #111111;
}

.cafe-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #27ae60;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    word-break: break-all;
}

.cafe-link:hover {
    text-decoration: underline;
}

.cafe-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-action-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #27ae60;
    color: #ffffff;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.25);
    transition: background 0.18s ease, transform 0.18s ease;
    cursor: pointer;
}

.btn-action-primary:hover {
    background: #219653;
    transform: translateY(-1px);
}

.btn-action-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    color: #374151;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s ease;
}

.btn-action-secondary:hover {
    background: #e5e7eb;
}

/* ============================================================
   4. Stats & Cards Grid (2 Columns)
   ============================================================ */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dash-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon-gold {
    background: #fef3c7;
    color: #b45309;
}

.card-icon-blue {
    background: #e0f2fe;
    color: #0284c7;
}

.card-title {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    color: #111111;
}

.card-subtitle {
    margin: 2px 0 0;
    font-size: 0.84rem;
    color: #6b7280;
}

/* --- Subscription Card Details --- */
.sub-status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge-trial {
    background: #fef3c7;
    color: #b45309;
}

.status-badge-active {
    background: #ecfdf5;
    color: #065f46;
}

.status-badge-expired {
    background: #fee2e2;
    color: #991b1b;
}

.sub-meta {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.6;
    margin: 0;
}

.sub-meta strong {
    color: #111111;
}

/* --- Support Card Details --- */
.support-number {
    font-size: 1.35rem;
    font-weight: 800;
    color: #111111;
    margin: 6px 0 16px;
    letter-spacing: 0.5px;
}

.support-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-contact {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s ease, background 0.15s ease;
}

.btn-whatsapp {
    background: #25d366;
    color: #ffffff;
}

.btn-whatsapp:hover {
    background: #20ba59;
    transform: translateY(-1px);
}

.btn-call {
    background: #f3f4f6;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.btn-call:hover {
    background: #e5e7eb;
}

/* ============================================================
   5. QR Code & Stand Card Styles
   ============================================================ */
.btn-action-qr {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0f172a;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.btn-action-qr:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

.card-icon-green {
    background: #dcfce7;
    color: #16a34a;
}

.dash-card-qr {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #ffffff 0%, #fcfdfd 100%);
    border: 1.5px solid #e2e8f0;
}

.qr-preview-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    margin: 10px 0 20px;
}

.dash-qr-container {
    background: #ffffff;
    padding: 14px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 170px;
    min-height: 170px;
}

.dash-qr-container canvas,
.dash-qr-container img {
    display: block;
    border-radius: 6px;
}

.qr-loading-placeholder {
    color: #94a3b8;
    font-size: 0.85rem;
}

.qr-scan-instruction {
    margin: 12px 0 0;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.qr-buttons-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-qr-action.btn-pdf-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #27ae60;
    color: #ffffff;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.98rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(39, 174, 96, 0.28);
    transition: background 0.18s ease, transform 0.18s ease;
}

.btn-qr-action.btn-pdf-download:hover {
    background: #219653;
    transform: translateY(-1px);
}

.qr-secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-qr-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f1f5f9;
    color: #334155;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-qr-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Subscription Extra Controls */
.sub-plan-info {
    margin-top: 10px;
    font-size: 0.86rem;
    color: #64748b;
}

.sub-plan-info strong {
    color: #0f172a;
}

.btn-renew-trigger {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    background: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease;
}

.btn-renew-trigger:hover {
    background: #1e293b;
}

/* ============================================================
   6. Locked Dashboard Overlay (For Unpaid/Expired Accounts)
   ============================================================ */
.dash-locked-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: lockFadeIn 0.25s ease-out;
}

@keyframes lockFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.locked-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 38px 30px;
    max-width: 520px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.locked-icon-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fee2e2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 18px;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.18);
}

.locked-card h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px;
    letter-spacing: -0.3px;
}

.locked-card p {
    font-size: 0.92rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 22px;
}

.locked-plan-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 0.88rem;
}

.locked-plan-lbl {
    color: #64748b;
}

.locked-plan-val {
    font-weight: 700;
    color: #0f172a;
}

.locked-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-locked-renew {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 22px;
    background: #27ae60;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(39, 174, 96, 0.35);
    transition: background 0.18s ease, transform 0.18s ease;
}

.btn-locked-renew:hover {
    background: #219653;
    transform: translateY(-1px);
}

.btn-locked-logout {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-locked-logout:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.locked-support-hint {
    margin-top: 20px;
    font-size: 0.82rem;
    color: #94a3b8;
}

.locked-support-hint a {
    color: #0284c7;
    font-weight: 600;
    text-decoration: none;
}

.locked-support-hint a:hover {
    text-decoration: underline;
}

/* ============================================================
   7. Renew & Plan Selection Modal Styles
   ============================================================ */
.renew-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: lockFadeIn 0.2s ease-out;
}

.renew-modal-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
}

.renew-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
}

.renew-modal-header h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px;
}

.renew-modal-header p {
    font-size: 0.88rem;
    color: #64748b;
    margin: 0;
}

.btn-close-renew {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-close-renew:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.renew-plans-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 22px;
}

.renew-plan-card {
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    cursor: pointer;
    background: #ffffff;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.renew-plan-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.05);
}

.renew-plan-card.active {
    border-color: #27ae60;
    background: #fcfdfd;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.12);
}

.plan-badge-save {
    position: absolute;
    top: -11px;
    right: 16px;
    background: #10b981;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

.plan-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.plan-radio-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: inline-block;
    position: relative;
    transition: all 0.2s;
}

.renew-plan-card.active .plan-radio-dot {
    border-color: #27ae60;
    background: #27ae60;
}

.renew-plan-card.active .plan-radio-dot:after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.plan-tag {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 6px;
}

.plan-tag.gold {
    color: #b45309;
    background: #fef3c7;
}

.plan-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.plan-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 4px;
}

.plan-price .currency {
    font-size: 1rem;
    font-weight: 700;
    color: #27ae60;
}

.plan-price .period {
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
}

.plan-saving-sub {
    font-size: 0.78rem;
    color: #059669;
    font-weight: 600;
    margin-bottom: 12px;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.8rem;
    color: #475569;
}

.renew-modal-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.btn-flouci-pay {
    width: 100%;
    background: #27ae60;
    color: #ffffff;
    padding: 15px 24px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    transition: background 0.18s ease, transform 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-flouci-pay:hover {
    background: #219653;
    transform: translateY(-1px);
}

.btn-flouci-pay:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.renew-error-msg {
    color: #dc2626;
    background: #fee2e2;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    width: 100%;
    text-align: center;
}

.renew-security-note {
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0;
    text-align: center;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   8. Mobile Responsive
   ============================================================ */
@media (max-width: 768px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }

    .renew-plans-grid {
        grid-template-columns: 1fr;
    }

    .cafe-hero-card {
        padding: 20px;
    }

    .cafe-actions {
        width: 100%;
    }

    .btn-action-primary, .btn-action-secondary, .btn-action-qr {
        width: 100%;
        justify-content: center;
    }
}

