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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #f8fafc;
    --card: #eef3fc;
    --card-alt: #f7faff;
    --border: #d6e2f5;
    --text: #1e293b;
    --text-muted: #64748b;
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Cairo', Arial, sans-serif;
    background: linear-gradient(135deg, #eef2fb 0%, #dce7f5 100%);
    background-attachment: fixed;
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-wrap {
    flex: 1 0 auto;
    width: 100%;
    padding: 40px 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

h1 {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 30px;
}

h2 {
    color: var(--text);
}

.search-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}

form {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"],
input[type="email"],
input[type="url"] {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

button {
    padding: 12px 24px;
    font-size: 16px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
}

button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.4);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

th {
    background-color: var(--primary);
    color: white;
    padding: 12px;
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    transition: background-color 0.15s;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:nth-child(even) {
    background-color: var(--card-alt);
}

tbody tr:hover td {
    background-color: #dbe7fb;
}

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

a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    table {
        border: none;
        box-shadow: none;
        background: transparent;
    }

    tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px 16px;
        background: var(--card);
        border-radius: 14px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        margin-bottom: 20px;
        padding: 16px;
    }

    tbody tr:nth-child(even) {
        background-color: var(--card);
    }

    td {
        display: block;
        padding: 0;
        border: none;
        text-align: center;
        font-size: 14px;
    }

    td::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        font-weight: 700;
        color: var(--text-muted);
        margin-bottom: 3px;
    }

    td[data-label="المنتج"] {
        grid-column: 1 / -1;
        font-size: 18px;
        font-weight: 700;
        color: var(--text);
        border-bottom: 1px solid var(--border);
        padding-bottom: 12px;
    }

    td[data-label="المنتج"]::before {
        display: none;
    }

    td[data-label="السعر"] {
        grid-column: 1 / -1;
        font-size: 22px;
        font-weight: 700;
        color: var(--primary);
        margin-top: -6px;
    }
}

.page-wrap.center-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-column {
    flex-direction: column;
}

.hp-field {
    position: absolute;
    left: -9999px;
}

.btn-link {
    background: none;
    box-shadow: none;
    color: var(--primary);
    font-weight: 600;
    padding: 8px 0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.btn-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
    transform: none;
    box-shadow: none;
}

.status-active {
    color: #16a34a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 12px 16px;
    border-radius: 8px;
    display: inline-block;
}

.status-inactive {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 12px 16px;
    border-radius: 8px;
    display: inline-block;
}

.top-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.nav-link {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--primary);
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
    text-decoration: none;
}

.dashboard-header .top-nav {
    margin-bottom: 15px;
}

.shop-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.dashboard-header h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.nav-link-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.nav-link-danger:hover {
    background: #dc2626;
    color: white;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
}

.notice-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: right;
}

.admin-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.btn-danger {
    background-color: #dc2626;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.btn-danger:hover {
    background-color: #b91c1c;
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.4);
}

.btn-secondary {
    background-color: var(--text-muted);
    box-shadow: none;
    padding: 6px 14px;
    font-size: 13px;
}

.btn-secondary:hover {
    background-color: #475569;
    box-shadow: none;
}

.active {
    color: #16a34a;
    font-weight: 600;
}

.expired {
    color: #dc2626;
    font-weight: 600;
}

.input-lg {
    padding: 16px 18px;
    font-size: 18px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.pagination a {
    background: var(--primary);
    color: white;
    padding: 10px 22px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.4);
    text-decoration: none;
}

.pagination span {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
}

.status-warning {
    color: #d97706;
    background: #fffbeb;
    border: 1px solid #fde68a;
    padding: 12px 16px;
    border-radius: 8px;
    display: inline-block;
}

.expiring {
    color: #d97706;
    font-weight: 600;
}

.site-footer {
    flex-shrink: 0;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 20px 30px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.8;
}

.site-footer a {
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: underline;
}

.site-footer a:hover {
    color: var(--primary);
}