@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

/* =============================================
   SouqPhone — Seller & Auth Styles
   ============================================= */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --accent: #7c3aed;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --dark: #101828;
    --text: #344054;
    --muted: #667085;
    --border: #e4e7ec;
    --surface: #ffffff;
    --bg: #f4f6fb;
    --sidebar-w: 260px;
    --radius: 14px;
    --shadow: 0 4px 20px rgba(16, 24, 40, .07);
    --shadow-md: 0 8px 30px rgba(16, 24, 40, .12);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', Tahoma, sans-serif;
    color: var(--text);
    line-height: 1.7;
    font-size: 14px;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

textarea {
    resize: vertical;
}

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

/* =============================================
   AUTH PAGES (Login / Register)
   ============================================= */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0f172a 100%);
    padding: 24px;
}

.auth-wrapper {
    width: 100%;
    max-width: 480px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 24px;
}

.auth-brand a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 24px;
    font-weight: 800;
}

.auth-brand p {
    color: rgba(255, 255, 255, .6);
    font-size: 13px;
    margin-top: 6px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: var(--primary);
    border-radius: 12px;
    color: white;
    font-size: 22px;
    font-weight: 800;
}

.auth-card {
    background: white;
    border-radius: 22px;
    padding: 36px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.auth-header {
    margin-bottom: 24px;
    text-align: center;
}

.auth-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--dark);
}

.auth-header p {
    color: var(--muted);
    font-size: 14px;
    margin-top: 6px;
}

/* Fields */
.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-weight: 700;
    margin-bottom: 7px;
    color: var(--dark);
    font-size: 13px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    color: var(--dark);
    background: white;
    transition: border-color .2s, box-shadow .2s;
    font-size: 14px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.field small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 5px;
}

/* Form sections */
fieldset.form-section {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

fieldset.form-section legend {
    padding: 0 8px;
    font-weight: 800;
    color: var(--primary);
    font-size: 13px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1.5px solid transparent;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    transition: all .2s;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-seller {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .3);
}

.btn-seller:hover {
    box-shadow: 0 6px 20px rgba(37, 99, 235, .4);
    transform: translateY(-2px);
}

.btn-ghost {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    background: var(--border);
}

.btn-full {
    width: 100%;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 13px;
    font-weight: 600;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
}

.alert-error ul {
    padding-right: 18px;
    margin: 0;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--success);
}

.auth-link {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin-top: 16px;
}

.auth-link a {
    color: var(--primary);
    font-weight: 700;
}

/* Success state */
.auth-success {
    text-align: center;
    padding: 16px 0;
}

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f0fdf4;
    color: var(--success);
    font-size: 28px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    border: 2px solid #bbf7d0;
}

.auth-success h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 10px;
}

.auth-success p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* =============================================
   SELLER DASHBOARD LAYOUT
   ============================================= */
.seller-body {
    background: var(--bg);
    min-height: 100vh;
}

.seller-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.seller-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--dark);
    display: flex;
    flex-direction: column;
    padding: 0 0 20px;
    z-index: 200;
    transition: transform .3s;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 20px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-brand a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 19px;
    font-weight: 800;
}

.shop-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.shop-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-weight: 800;
    font-size: 18px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.shop-info strong {
    display: block;
    color: white;
    font-size: 13px;
    font-weight: 700;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.badge-success {
    background: rgba(22, 163, 74, .2);
    color: #4ade80;
}

.badge-warn {
    background: rgba(217, 119, 6, .2);
    color: #fbbf24;
}

.badge-info {
    background: rgba(37, 99, 235, .15);
    color: #60a5fa;
}

/* Nav */
.seller-nav {
    flex: 1;
    padding: 12px 12px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, .65);
    font-size: 13.5px;
    font-weight: 600;
    transition: all .2s;
    margin-bottom: 4px;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, .08);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
}

.nav-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
}

.nav-badge {
    margin-right: auto;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 20px;
}

.sidebar-logout {
    padding: 12px 20px 0;
    border-top: 1px solid rgba(255, 255, 255, .06);
    margin-top: 12px;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .65);
    font-size: 13px;
    font-weight: 600;
    transition: all .2s;
}

.logout-btn:hover {
    background: rgba(220, 38, 38, .15);
    border-color: rgba(220, 38, 38, .3);
    color: #fca5a5;
}

/* ---- Main Content ---- */
.seller-main {
    flex: 1;
    margin-right: var(--sidebar-w);
    padding: 0 28px 40px;
    max-width: 1100px;
    width: 100%;
}

/* Topbar */
.seller-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 0 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.seller-topbar h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark);
    margin: 0;
    line-height: 1.3;
}

.seller-topbar .btn {
    margin-right: auto;
}

.menu-toggle {
    display: none;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 7px 10px;
    color: var(--dark);
    font-size: 18px;
}

/* Notice banners */
.notice-banner {
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 600;
}

.notice-warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.notice-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.notice-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #14532d;
}

.notice-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* =============================================
   STATS GRID
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform .2s, box-shadow .2s;
}

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

.stat-icon {
    font-size: 28px;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.stat-blue .stat-icon {
    background: #eff6ff;
}

.stat-orange .stat-icon {
    background: #fff7ed;
}

.stat-purple .stat-icon {
    background: #f5f3ff;
}

.stat-green .stat-icon {
    background: #f0fdf4;
}

.stat-info span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.stat-info strong {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.3;
}

/* =============================================
   QUICK ACTIONS
   ============================================= */
.quick-actions {
    margin-bottom: 24px;
}

.quick-actions h2 {
    font-size: 16px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 14px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.action-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 13px;
    color: var(--dark);
    transition: all .2s;
    cursor: pointer;
}

.action-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.action-icon {
    font-size: 28px;
    width: 50px;
    height: 50px;
    background: var(--bg);
    border-radius: 12px;
    display: grid;
    place-items: center;
}

/* =============================================
   SELLER PANELS (Cards)
   ============================================= */
.seller-panel {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.seller-panel h2 {
    font-size: 17px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 6px;
}

.seller-panel>p {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.see-all {
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.empty-panel {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

.empty-panel span {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

.empty-panel p {
    font-size: 14px;
}

/* =============================================
   FORM GRID
   ============================================= */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.field-full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 10px;
}

/* =============================================
   DATA TABLE
   ============================================= */
.table-scroll {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    text-align: right;
    padding: 10px 14px;
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: #fafbff;
}

/* =============================================
   STATUS BADGES
   ============================================= */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.status-active {
    background: #f0fdf4;
    color: #15803d;
}

.status-inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.status-pending {
    background: #fffbeb;
    color: #b45309;
}

.status-confirmed {
    background: #eff6ff;
    color: #1d4ed8;
}

.status-cancelled {
    background: #fef2f2;
    color: #b91c1c;
}

.status-completed {
    background: #f0fdf4;
    color: #15803d;
}

.status-claimed {
    background: #f5f3ff;
    color: #6d28d9;
}

.status-expired {
    background: #f3f4f6;
    color: #6b7280;
}

/* =============================================
   ACTION BUTTONS
   ============================================= */
.actions-cell {
    white-space: nowrap;
    /*display: flex;
    gap: 8px;
    align-items: center;*/
}

.action-btn {
    padding: 5px 12px;
    border-radius: 7px;
    border: 1.5px solid var(--border);
    background: white;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    transition: all .2s;
}

.action-btn:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}

.action-btn.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: #fef2f2;
}

/* =============================================
   DEALS GRID
   ============================================= */
.deals-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.deal-card {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    position: relative;
    background: white;
    transition: transform .2s, box-shadow .2s;
}

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

.deal-active {
    border-color: #93c5fd;
}

.deal-claimed {
    border-color: #c4b5fd;
    opacity: .8;
}

.deal-expired,
.deal-cancelled {
    opacity: .6;
}

.deal-badge {
    position: absolute;
    top: -1px;
    left: 14px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: white;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 0 0 10px 10px;
}

.deal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    margin-top: 14px;
}

.deal-header h3 {
    font-size: 15px;
    font-weight: 800;
    color: var(--dark);
}

.deal-phone {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 12px;
}

.deal-prices {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.deal-original {
    color: var(--muted);
    text-decoration: line-through;
    font-size: 13px;
}

.deal-new {
    color: var(--primary);
    font-size: 20px;
    font-weight: 800;
}

.deal-expires,
.deal-claimed {
    color: var(--muted);
    font-size: 12px;
}

.deal-claimed {
    color: var(--success);
}

.deal-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* =============================================
   ADS LIST
   ============================================= */
.ads-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ad-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    transition: border-color .2s;
}

.ad-item:hover {
    border-color: var(--primary);
}

.ad-img-thumb {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.ad-img-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-img-placeholder {
    width: 80px;
    height: 60px;
    background: var(--border);
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 24px;
    flex-shrink: 0;
}

.ad-info {
    flex: 1;
}

.ad-info h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
}

.ad-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

.ad-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* =============================================
   FILTER TABS
   ============================================= */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    border: 1.5px solid var(--border);
    background: white;
    transition: all .2s;
}

.tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .deals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-w: 0px;
    }

    .seller-sidebar {
        transform: translateX(100%);
        width: 260px;
    }

    .seller-sidebar.open {
        transform: translateX(0);
        box-shadow: -8px 0 30px rgba(0, 0, 0, .3);
    }

    .seller-main {
        margin-right: 0;
        padding: 0 16px 40px;
    }

    .menu-toggle {
        display: block;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .field-full {
        grid-column: auto;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .actions-grid {
        grid-template-columns: 1fr 1fr;
    }

    .deals-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .actions-grid {
        grid-template-columns: 1fr 1fr;
    }

    .seller-topbar {
        flex-wrap: wrap;
    }

    .seller-topbar .btn {
        margin-right: 0;
        width: 100%;
    }
}