/* =========================================================
   IRAN CHEM — ADMIN PANEL
   Premium dark administration UI
   PHP 8.2 / MySQL
========================================================= */

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    background: #f5f2ec;
}

body {
    margin: 0;
    padding: 0;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    background: #f5f2ec;
    color: #16191b;
    line-height: 1.5;
}

/* =========================================================
   LINKS
========================================================= */

a {
    color: #78988a;
    text-decoration: none;
    transition: .2s ease;
}

a:hover {
    color: #9db7aa;
}

/* =========================================================
   HEADER
========================================================= */

.admin-header {
    width: 100%;
    background: #0d1011;
    border-bottom: 1px solid #25292b;
}

.admin-header-inner {
    width: min(1100px, calc(100% - 40px));
    min-height: 72px;
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;

    color: #f5f2ec;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.admin-brand span {
    color: #b68a62;
    font-size: 11px;
    letter-spacing: .15em;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-nav a {
    color: #d7d9d8;
    font-size: 13px;
}

.admin-nav a:hover {
    color: #ffffff;
}

/* =========================================================
   MAIN
========================================================= */

.admin-wrap {
    width: min(1100px, calc(100% - 40px));
    margin: 0 auto;
    padding: 50px 0 80px;
}

.admin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 30px;
    margin-bottom: 40px;
}

.admin-page-title {
    margin: 0 0 8px;

    color: #111315;

    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -.035em;
}

.admin-page-subtitle {
    margin: 0;

    color: #737a78;
    font-size: 15px;
}

/* =========================================================
   CARDS
========================================================= */

.card {
    background: #ffffff;
    border: 1px solid #dedbd5;
    border-radius: 18px;

    padding: 28px;

    box-shadow:
        0 8px 30px rgba(20, 23, 24, .05);
}

.card + .card {
    margin-top: 24px;
}

/* =========================================================
   FORM
========================================================= */

.form {
    width: 100%;
    background: #171b1d;

    border: 1px solid #292e30;
    border-radius: 18px;

    padding: 34px;

    color: #ffffff;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, .10);
}

.form h1,
.form h2,
.form h3 {
    margin-top: 0;
    color: #ffffff;
}

.form h2 {
    margin-bottom: 28px;

    font-size: 24px;
    line-height: 1.2;
    font-weight: 750;
    letter-spacing: -.02em;
}

/* =========================================================
   FIELD
========================================================= */

.field {
    margin-bottom: 24px;
}

.field label {
    display: block;

    margin-bottom: 9px;

    color: #f1f3f2;

    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.field small,
.help {
    display: block;

    margin-top: 7px;

    color: #8d9692;

    font-size: 12px;
    line-height: 1.5;
}

/* =========================================================
   INPUTS
========================================================= */

.field input,
.field textarea,
.field select,
input,
textarea,
select {
    width: 100%;

    min-height: 48px;

    padding: 13px 15px;

    border: 1px solid #3b4143;
    border-radius: 10px;

    background: #101315;
    color: #f4f5f4;

    font-family: inherit;
    font-size: 14px;

    outline: none;

    transition:
        border-color .2s ease,
        background .2s ease,
        box-shadow .2s ease;
}

.field textarea,
textarea {
    min-height: 130px;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder,
input::placeholder,
textarea::placeholder {
    color: #707976;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: #86a393;

    background: #121719;

    box-shadow:
        0 0 0 3px rgba(134, 163, 147, .12);
}

/* =========================================================
   SELECT
========================================================= */

select {
    appearance: auto;
    cursor: pointer;
}

select option {
    background: #171b1d;
    color: #ffffff;
}

/* =========================================================
   GRID
========================================================= */

.form-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 24px;
}

.form-grid-3 {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 20px;
}

.full {
    grid-column: 1 / -1;
}

/* =========================================================
   SECTIONS INSIDE FORM
========================================================= */

.form-section {
    margin-bottom: 36px;
    padding-bottom: 34px;

    border-bottom: 1px solid #292e30;
}

.form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.form-section-title {
    margin: 0 0 24px;

    color: #ffffff;

    font-size: 20px;
    line-height: 1.2;
    font-weight: 750;
    letter-spacing: -.02em;
}

.form-section-description {
    margin: -14px 0 24px;

    color: #89918e;

    font-size: 13px;
}

/* =========================================================
   CHECKBOX
========================================================= */

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;

    min-height: 48px;

    padding: 12px 14px;

    background: #101315;

    border: 1px solid #303638;
    border-radius: 10px;

    cursor: pointer;
}

.checkbox input {
    width: 18px;
    height: 18px;

    min-height: auto;

    padding: 0;

    accent-color: #86a393;

    box-shadow: none;
}

.checkbox span {
    color: #e8ebe9;

    font-size: 14px;
    font-weight: 600;
}

/* =========================================================
   BUTTONS
========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;

    padding: 0 22px;

    border: 1px solid #86a393;
    border-radius: 10px;

    background: #86a393;
    color: #0e1112;

    font-family: inherit;
    font-size: 14px;
    font-weight: 750;

    cursor: pointer;

    transition:
        transform .2s ease,
        background .2s ease,
        border-color .2s ease;
}

.btn:hover {
    background: #9ab3a4;
    border-color: #9ab3a4;

    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    border-color: #4a5350;
    color: #dfe4e1;
}

.btn-secondary:hover {
    background: #222729;
    border-color: #6b7d73;
}

.btn-danger {
    background: #8e4e4e;
    border-color: #8e4e4e;
    color: #ffffff;
}

.btn-danger:hover {
    background: #a25b5b;
    border-color: #a25b5b;
}

/* =========================================================
   FORM ACTIONS
========================================================= */

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-top: 34px;
    padding-top: 26px;

    border-top: 1px solid #292e30;
}

.form-actions-left,
.form-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* =========================================================
   ALERTS
========================================================= */

.alert {
    margin-bottom: 24px;

    padding: 14px 16px;

    border: 1px solid #704343;
    border-radius: 10px;

    background: #2a1d1f;
    color: #ffb7b7;

    font-size: 14px;
}

.alert-success {
    border-color: #4b6758;
    background: #18251f;
    color: #b9d6c6;
}

.alert-warning {
    border-color: #766344;
    background: #292419;
    color: #e6cf9f;
}

/* =========================================================
   MUTED TEXT
========================================================= */

.muted {
    color: #89918e;
}

.form .muted {
    color: #9ca5a1;
}

/* =========================================================
   TABLE
========================================================= */

.table-wrap {
    overflow-x: auto;

    border: 1px solid #dedbd5;
    border-radius: 14px;

    background: #ffffff;
}

table {
    width: 100%;

    border-collapse: collapse;

    font-size: 14px;
}

th {
    padding: 15px;

    background: #f0ede7;

    color: #555d5a;

    font-size: 12px;
    font-weight: 750;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .04em;
}

td {
    padding: 15px;

    border-top: 1px solid #ebe8e2;

    color: #202526;
}

tr:hover td {
    background: #faf9f6;
}

/* =========================================================
   BADGES
========================================================= */

.badge {
    display: inline-flex;
    align-items: center;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 750;
}

.badge-active {
    background: #e2eee7;
    color: #416453;
}

.badge-inactive {
    background: #eee7e4;
    color: #79594d;
}

/* =========================================================
   DASHBOARD
========================================================= */

.stats {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 28px;
}

.stat {
    padding: 24px;

    border: 1px solid #dedbd5;
    border-radius: 16px;

    background: #ffffff;
}

.stat-value {
    display: block;

    margin-bottom: 5px;

    color: #111315;

    font-size: 32px;
    font-weight: 800;
}

.stat-label {
    color: #737a78;

    font-size: 13px;
}

/* =========================================================
   LOGIN
========================================================= */

body.admin-login {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(
            circle at 50% 20%,
            #1d2422 0,
            #101314 45%,
            #0c0f10 100%
        );
}

.admin-login .admin-wrap {
    width: min(460px, calc(100% - 30px));
    padding: 30px 0;
}

.admin-login .form {
    padding: 38px;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .admin-header-inner {
        flex-direction: column;
        align-items: flex-start;

        padding: 18px 0;
    }

    .admin-nav {
        width: 100%;

        flex-wrap: wrap;
        gap: 12px 18px;
    }

    .admin-page-header {
        flex-direction: column;
    }

    .form-grid,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {

    .admin-wrap {
        width: min(100% - 24px, 1100px);
        padding: 30px 0 50px;
    }

    .admin-header-inner {
        width: calc(100% - 24px);
    }

    .admin-page-title {
        font-size: 34px;
    }

    .form {
        padding: 22px 18px;
        border-radius: 14px;
    }

    .form-grid {
        gap: 0;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions-left,
    .form-actions-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .stats {
        grid-template-columns: 1fr;
    }
}