/* ═══════════════════════════════════════════════════
   CallServ - Modern Restaurant Notification System
   ═══════════════════════════════════════════════════ */

/* ─── Base ─── */
* { box-sizing: border-box; }

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--cs-bg, #0f172a);
    color: var(--cs-text, #f8fafc);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

a { color: var(--cs-accent, #06b6d4); }
a:hover { color: var(--cs-primary, #6366f1); }

/* ─── Login Page ─── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--cs-bg, #0f172a) 0%, #1a1a2e 50%, var(--cs-bg, #0f172a) 100%);
    padding: 20px;
}

.login-container { width: 100%; max-width: 420px; }

.login-card {
    background: var(--cs-card, #1e293b);
    border-radius: 24px;
    padding: 40px 32px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
}

.login-header { text-align: center; margin-bottom: 32px; }

.login-icon {
    width: 80px; height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-secondary));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    font-size: 2rem; color: white;
}

.login-logo { max-height: 80px; margin-bottom: 16px; }

.login-header h2 {
    color: var(--cs-text);
    font-weight: 700;
    margin: 8px 0;
}

.login-card .form-control {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--cs-text);
    border-radius: 12px;
    padding: 14px 16px;
    height: auto;
}

.login-card .form-control:focus {
    background: rgba(255,255,255,0.08);
    border-color: var(--cs-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    color: var(--cs-text);
}

.login-card .form-floating label { color: rgba(255,255,255,0.5); }

.login-btn {
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-secondary));
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99,102,241,0.3);
}

.login-subtitle {
    color: white;
    font-size: 0.95rem;
    margin: 0;
    opacity: 0.85;
}

.login-version {
    text-align: center;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    margin: 16px 0 4px;
}

.login-footer {
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.75rem;
    margin: 0;
}

/* ─── Customer Page ─── */
.customer-page {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--cs-bg, #0f172a) 0%, #1a1a2e 100%);
    padding: 20px;
}

.customer-container {
    max-width: 480px;
    margin: 0 auto;
}

.customer-header {
    text-align: center;
    padding: 30px 0 20px;
}

.customer-logo {
    max-height: 80px;
    border-radius: 16px;
    margin-bottom: 12px;
}

.customer-logo-placeholder {
    width: 80px; height: 80px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-secondary));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
    font-size: 2rem; color: white;
}

.customer-header h2 {
    font-weight: 700;
    margin: 8px 0;
}

.table-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-secondary));
    color: white;
    padding: 8px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
}

.section-card {
    background: var(--cs-card, #1e293b);
    border-radius: 20px;
    padding: 28px 24px;
    border: 1px solid rgba(255,255,255,0.05);
}

.section-card h5 { font-weight: 700; }

.customer-section { margin-top: 20px; }

/* Privacy Button */
.privacy-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px 18px;
    margin-bottom: 18px;
    border: 2px solid rgba(99,102,241,0.3);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.06));
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    outline: none;
    font-family: inherit;
    text-align: right;
}
.privacy-btn:active { transform: scale(0.97); }
.privacy-btn:hover {
    border-color: rgba(99,102,241,0.5);
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.08));
}

/* Icon circle */
.privacy-btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(99,102,241,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #a5b4fc;
    flex-shrink: 0;
    transition: all 0.35s;
}

/* Label */
.privacy-btn-label {
    flex: 1;
    min-width: 0;
}
.privacy-btn-label strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2px;
}
.privacy-btn-label small {
    color: #94a3b8;
    font-size: 0.8rem;
    line-height: 1.3;
}

/* Status badge */
.privacy-btn-status {
    flex-shrink: 0;
    padding: 6px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99,102,241,0.25);
    transition: all 0.35s;
}

/* Active state — red */
.privacy-btn.active {
    border-color: rgba(239,68,68,0.4);
    background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(239,68,68,0.05));
    box-shadow: 0 0 24px rgba(239,68,68,0.1);
}
.privacy-btn.active .privacy-btn-icon {
    background: rgba(239,68,68,0.2);
    color: #f87171;
}
.privacy-btn.active .privacy-btn-label strong { color: #fca5a5; }
.privacy-btn.active .privacy-btn-label small { color: rgba(248,113,113,0.6); }
.privacy-btn.active .privacy-btn-status {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

.session-info {
    text-align: center;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.session-phone {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Call Buttons Grid */
.call-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.call-button {
    background: var(--cs-card, #1e293b);
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--cs-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.call-button:hover {
    border-color: var(--btn-color, var(--cs-primary));
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.call-button:active {
    transform: scale(0.95);
}

.call-button.sending {
    animation: pulse-send 0.6s ease;
}

@keyframes pulse-send {
    0% { transform: scale(1); }
    50% { transform: scale(0.9); border-color: var(--btn-color); box-shadow: 0 0 30px var(--btn-color); }
    100% { transform: scale(1); }
}

.call-button-icon {
    width: 60px; height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--btn-color, var(--cs-primary)), transparent);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    color: var(--btn-color, var(--cs-primary));
}

.call-button-text {
    font-weight: 600;
    font-size: 1rem;
}

/* Status Messages */
.status-area {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: calc(100% - 40px);
    max-width: 420px;
}

.status-card {
    background: var(--cs-card);
    border-radius: 16px;
    padding: 16px 24px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    animation: slideUp 0.3s ease;
}

.status-success { border-color: #10b981; }
.status-warning { border-color: #f59e0b; }
.status-danger { border-color: #ef4444; }

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.blocked-icon {
    font-size: 3rem;
    color: #f59e0b;
    margin-bottom: 12px;
}

/* Connection Overlay — full section loader */
.connection-overlay-full {
    text-align: center;
    padding: 48px 20px;
    transition: opacity 0.5s ease, max-height 0.5s ease;
    overflow: hidden;
}
.connection-overlay-full.fade-out {
    opacity: 0;
    max-height: 0 !important;
    padding: 0 20px;
    pointer-events: none;
}
.connection-overlay-content {
    text-align: center;
    color: rgba(255,255,255,0.9);
}
.connection-overlay-content h6 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}
.connection-overlay-content p {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255,255,255,0.5);
}

/* Service Content — fades in after connection */
.service-content {
    transition: opacity 0.6s ease;
}

/* Animated Ring Loader */
.loader-ring {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto;
}
.loader-ring-inner {
    position: absolute;
    inset: 0;
    border: 3px solid rgba(255,255,255,0.08);
    border-top-color: #6366f1;
    border-right-color: #8b5cf6;
    border-radius: 50%;
    animation: loaderSpin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.loader-ring-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: rgba(255,255,255,0.6);
    animation: loaderPulse 2s ease-in-out infinite;
}
@keyframes loaderSpin {
    to { transform: rotate(360deg); }
}
@keyframes loaderPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Loading Dots */
.loader-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}
.loader-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6366f1;
    animation: dotBounce 1.4s ease-in-out infinite;
}
.loader-dots span:nth-child(2) { animation-delay: 0.15s; }
.loader-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotBounce {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.2); }
}

.call-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ─── Waiter Dashboard ─── */
.waiter-page {
    min-height: 100vh;
    background: var(--cs-bg, #0f172a);
    padding-bottom: 20px;
}

.waiter-header {
    background: var(--cs-card, #1e293b);
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.waiter-header-logo {
    height: 40px;
    border-radius: 10px;
}

.connection-status {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
}

.connection-status.connected { color: #10b981; background: rgba(16,185,129,0.1); }
.connection-status.disconnected { color: #ef4444; background: rgba(239,68,68,0.1); }

.waiter-section { padding: 16px 20px; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h5 { margin: 0; font-weight: 700; }

.calls-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255,255,255,0.3);
    font-size: 1.1rem;
}

.empty-state i { font-size: 3rem; display: block; margin-bottom: 12px; }

/* Call Cards */
.call-card {
    background: var(--cs-card, #1e293b);
    border-radius: 16px;
    padding: 16px;
    border-right: 4px solid transparent;
    transition: all 0.3s;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.call-pending {
    border-right-color: #f59e0b;
    animation: glow-pending 2s ease-in-out infinite alternate;
}

@keyframes glow-pending {
    from { box-shadow: 0 0 5px rgba(245,158,11,0.1); }
    to { box-shadow: 0 0 20px rgba(245,158,11,0.2); }
}

.call-seen { border-right-color: #06b6d4; }
.call-progress { border-right-color: #6366f1; }
.call-done { border-right-color: #10b981; opacity: 0.6; }

.call-new { animation: slideIn 0.5s ease; }

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateX(20px); height: 0; padding: 0; margin: 0; overflow: hidden; }
}

.call-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.call-table {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.call-time {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
}

.call-elapsed {
    font-size: 0.75rem;
    font-family: monospace;
    letter-spacing: 0.5px;
    min-width: 48px;
    text-align: center;
    transition: background-color 0.3s;
}

/* Privacy Banner in Waiter Dashboard */
.privacy-banner {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 14px;
    padding: 14px 16px;
    color: #e2e8f0;
}
.privacy-banner strong {
    color: #fca5a5;
}
.privacy-banner small {
    color: rgba(252,165,165,0.6) !important;
}
.privacy-table-tag {
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.call-type {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.call-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.call-card-actions .btn {
    flex: 1;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ─── Admin Layout ─── */
.admin-body {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

.admin-sidebar {
    width: 260px;
    background: var(--cs-card, #1e293b);
    border-left: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    z-index: 200;
    transition: right 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logo { max-height: 50px; border-radius: 12px; }

.sidebar-logo-placeholder {
    width: 50px; height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-secondary));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto;
    font-size: 1.3rem; color: white;
}

.sidebar-title {
    margin-top: 10px;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--cs-text);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-secondary));
    color: white;
}

.sidebar-nav .nav-link i { font-size: 1.2rem; width: 24px; text-align: center; }

.sidebar-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.25);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px 6px;
    margin-top: 4px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
}

.admin-content {
    flex: 1;
    margin-right: 260px;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100%;
}

.admin-topbar {
    background: var(--cs-card, #1e293b);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle { display: none; color: var(--cs-text); }

.admin-main {
    padding: 24px;
    overflow-x: hidden;
    max-width: 100%;
}

/* ─── Cards & Tables ─── */
.cs-card {
    background: var(--cs-card, #1e293b);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    color: var(--cs-text);
}

.cs-card .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 16px 20px;
    color: var(--cs-text);
}

.cs-card .card-body { padding: 20px; }

.cs-modal {
    background: var(--cs-card, #1e293b);
    color: var(--cs-text);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
}

.cs-modal .modal-header {
    border-bottom-color: rgba(255,255,255,0.05);
}

.cs-modal .modal-footer {
    border-top-color: rgba(255,255,255,0.05);
}

.cs-modal .form-control, .cs-modal .form-select {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    color: var(--cs-text);
}

.cs-modal .form-control:focus, .cs-modal .form-select:focus {
    background: rgba(255,255,255,0.08);
    border-color: var(--cs-primary);
    color: var(--cs-text);
}

.cs-table {
    color: var(--cs-text);
}

.cs-table th {
    border-color: rgba(255,255,255,0.05);
    font-weight: 600;
    font-size: 0.9rem;
}

.cs-table td { border-color: rgba(255,255,255,0.03); }

.table-hover tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

/* ─── Stat Cards ─── */
.stat-card {
    background: var(--cs-card, #1e293b);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.2s;
    overflow: hidden;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: white;
    flex-shrink: 0;
}

.stat-info {
    min-width: 0;
    overflow: hidden;
}

.stat-info h3 {
    font-weight: 800;
    font-size: 1.6rem;
    margin: 0;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-info p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Stat cards responsive — stack vertically on mobile/tablet */
@media (max-width: 768px) {
    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 14px 10px;
        gap: 8px;
    }
    .stat-icon {
        width: 44px; height: 44px;
        border-radius: 12px;
        font-size: 1.1rem;
    }
    .stat-info h3 {
        font-size: 1.2rem;
        white-space: normal;
    }
    .stat-info p {
        font-size: 0.75rem;
        white-space: normal;
    }
    .admin-main {
        padding: 16px 12px;
    }
}

/* Table Number Display */
.table-number-display {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 800;
    color: white;
    margin: 0 auto 12px;
}

/* Button Preview */
.button-preview {
    width: 60px; height: 60px;
    border-radius: 16px;
    border: 2px solid;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto;
}

/* Subscription Cards */
.subscription-card {
    transition: transform 0.2s;
    text-align: center;
    height: 100%;
}

.subscription-card:hover { transform: translateY(-4px); }

.plan-price {
    margin: 12px 0;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-currency {
    font-size: 1rem;
    color: rgba(255,255,255,0.5);
}

.plan-features {
    list-style: none;
    padding: 0;
    text-align: right;
    margin: 16px 0;
}

.plan-features li {
    padding: 6px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* ─── Responsive ─── */
@media (max-width: 992px) {
    .admin-sidebar {
        right: -280px !important;
        transform: none !important;
    }

    .admin-sidebar.show {
        right: 0 !important;
        transform: none !important;
    }

    .admin-content {
        margin-right: 0 !important;
    }

    .sidebar-toggle {
        display: block !important;
    }

    /* Overlay behind sidebar on mobile */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 199;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 576px) {
    .customer-header h2 { font-size: 1.4rem; }
    .call-buttons-grid { gap: 12px; }
    .call-button { padding: 20px 12px; }
    .call-button-icon { width: 50px; height: 50px; font-size: 1.5rem; }
}

/* ─── Customer Footer ─── */
.customer-footer {
    text-align: center;
    padding: 20px 0 10px;
    margin-top: 24px;
}
.customer-footer p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    margin: 0;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ─── Alerts ─── */
.alert {
    border-radius: 12px;
    border: none;
}

/* ─── Form Controls in Dark Theme ─── */
.admin-body .form-control,
.admin-body .form-select {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--cs-text);
    border-radius: 10px;
}

.admin-body .form-control:focus,
.admin-body .form-select:focus {
    background: rgba(255,255,255,0.08);
    border-color: var(--cs-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    color: var(--cs-text);
}

.admin-body .form-select option {
    background: #1e293b;
    color: #f8fafc;
}

.admin-body .form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
}

.admin-body .btn-primary {
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-secondary));
    border: none;
    border-radius: 10px;
    font-weight: 600;
}

.admin-body .btn-primary:hover {
    box-shadow: 0 8px 25px rgba(99,102,241,0.3);
}

.admin-body .progress {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    height: 8px;
}

/* ─── Fix text-muted and placeholder colors on dark backgrounds ─── */
.admin-body .text-muted,
.admin-body small.text-muted,
.admin-body .form-text {
    color: #94a3b8 !important;
}

.admin-body .form-control::placeholder,
.admin-body .form-select::placeholder {
    color: #64748b !important;
}

.admin-body .modal .text-muted {
    color: #94a3b8 !important;
}

/* ─── Progress bar fix - subscription days ─── */
.admin-body .progress {
    height: 28px;
    border-radius: 10px;
}
.admin-body .progress-bar {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 28px;
    min-width: 80px;
}

/* ─── Mobile card view for tables ─── */
.mobile-card-list .mobile-card {
    background: var(--cs-card, #1e293b);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,0.06);
}
.mobile-card-list .mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}
.mobile-card-list .mobile-card-label {
    color: #94a3b8;
    font-size: 0.85rem;
}
.mobile-card-list .mobile-card-value {
    font-weight: 600;
    font-size: 0.9rem;
}
.mobile-card-list .mobile-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    justify-content: flex-end;
}

/* Hide table on small, show cards */
.cs-cards-mobile { display: none; }

@media (max-width: 991px) {
    .cs-table-desktop { display: none !important; }
    .cs-cards-mobile { display: block !important; }
}
@media (min-width: 992px) {
    .cs-table-desktop { display: block !important; }
    .cs-cards-mobile { display: none !important; }
}

/* ─── Scrollable calls list ─── */
.calls-scrollable {
    max-height: 400px;
    overflow-y: auto;
}
.calls-scrollable::-webkit-scrollbar { width: 5px; }
.calls-scrollable::-webkit-scrollbar-track { background: transparent; }
.calls-scrollable::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 5px; }

/* ─── QR card fixes ─── */
.qr-link-box {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 6px 10px;
    overflow: hidden;
}
.qr-link {
    color: #94a3b8;
    font-size: 0.75rem;
    word-break: break-all;
    display: block;
    direction: ltr;
    text-align: center;
}

/* ─── Fix Bootstrap .table in dark admin theme ─── */
.admin-body .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--cs-text, #f8fafc);
    --bs-table-border-color: rgba(255,255,255,0.05);
    --bs-table-striped-bg: rgba(255,255,255,0.03);
    --bs-table-hover-bg: rgba(255,255,255,0.05);
    --bs-table-hover-color: var(--cs-text, #f8fafc);
}

/* ─── Quotation items table (Create/Edit forms) ─── */
#itemsTable thead th {
    background: rgba(255,255,255,0.08) !important;
    color: var(--cs-text, #f8fafc);
    font-weight: 600;
    white-space: nowrap;
}
#itemsTable tbody td {
    vertical-align: middle;
    border-color: rgba(255,255,255,0.05);
}
#itemsTable .form-control {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--cs-text, #f8fafc);
    font-size: 0.9rem;
}
#itemsTable .form-control:focus {
    background: rgba(255,255,255,0.1);
    border-color: var(--cs-primary, #6366f1);
    color: var(--cs-text, #f8fafc);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}
#itemsTable .form-control::placeholder {
    color: rgba(255,255,255,0.35) !important;
}
#itemsTable .item-total {
    color: var(--cs-accent, #06b6d4);
}

/* ─── Quotation forms mobile ─── */
@media (max-width: 768px) {
    #itemsTable th { font-size: 0.75rem; padding: 8px 4px; }
    #itemsTable td { padding: 6px 4px; }
    #itemsTable th:first-child { min-width: 100px !important; }
    #itemsTable .form-control { font-size: 0.8rem; padding: 6px 8px; }
    .admin-main { padding: 12px; }
}
