/* SMA Login UI */

:root {
    --sma-primary: #025da0;
    --sma-secondary: #39b5ff;
    --sma-accent: #10b981;
    --sma-deep: #05233d;
    --sma-text: #072745;
    --sma-muted: #5b7491;
    --sma-white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.19);
    --glass-border: rgba(255, 255, 255, 0.38);
    --panel-shadow:
        0 32px 60px -36px rgba(2, 28, 53, 0.68),
        0 20px 48px -30px rgba(2, 93, 160, 0.5);
    --control-shadow: 0 12px 26px -18px rgba(5, 35, 61, 0.5);
    --radius-xl: 24px;
    --radius-lg: 14px;
    --ease: 0.28s cubic-bezier(0.23, 1, 0.32, 1);
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
    line-height: 1.5;
    color: var(--sma-text);
}

.auth-page {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 16% 16%, rgba(57, 181, 255, 0.36), transparent 42%),
        radial-gradient(circle at 84% 12%, rgba(16, 185, 129, 0.26), transparent 34%),
        linear-gradient(150deg, #eef8ff 0%, #f8fbff 38%, #f2f7fc 100%);
}

.auth-page::before,
.auth-page::after {
    content: "";
    position: absolute;
    z-index: 0;
    filter: blur(2px);
    border-radius: 999px;
    pointer-events: none;
}

.auth-page::before {
    width: 380px;
    height: 380px;
    top: -130px;
    right: -80px;
    background: radial-gradient(circle, rgba(57, 181, 255, 0.4) 0%, rgba(57, 181, 255, 0) 70%);
}

.auth-page::after {
    width: 460px;
    height: 460px;
    left: -170px;
    bottom: -170px;
    background: radial-gradient(circle, rgba(2, 93, 160, 0.32) 0%, rgba(2, 93, 160, 0) 72%);
}

.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: clamp(20px, 4vw, 34px);
}

.auth-panel {
    width: min(100%, 460px);
    display: grid;
    gap: 14px;
}

.auth-card {
    position: relative;
    overflow: hidden;
    padding: clamp(24px, 4vw, 34px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.12)),
        var(--glass-bg);
    box-shadow: var(--panel-shadow);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(100deg, var(--sma-primary), var(--sma-secondary), var(--sma-accent));
}

.auth-brand {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.auth-logo-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--sma-white);
    background: linear-gradient(130deg, var(--sma-primary), var(--sma-secondary) 70%);
    box-shadow: 0 12px 24px -14px rgba(2, 93, 160, 0.82);
}

.auth-brand__eyebrow {
    margin: 2px 0 0;
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--sma-muted);
}

.auth-brand__logo {
    margin: 0;
    font-size: clamp(1.85rem, 4.2vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--sma-deep);
}

.auth-brand__tagline {
    margin: 0;
    font-size: 0.95rem;
    color: #4f6984;
}

.auth-form {
    display: grid;
    gap: 10px;
}

.auth-label {
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #285172;
}

.auth-input {
    width: 100%;
    border: 1px solid rgba(2, 93, 160, 0.24);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--sma-deep);
    box-shadow: var(--control-shadow);
    transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}

.auth-input::placeholder {
    color: #80a0bb;
}

.auth-input:focus {
    outline: none;
    border-color: rgba(57, 181, 255, 0.88);
    box-shadow:
        0 0 0 4px rgba(57, 181, 255, 0.2),
        0 16px 26px -20px rgba(2, 93, 160, 0.78);
    transform: translateY(-1px);
}

.auth-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 2px;
}

.auth-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sma-primary);
    text-decoration: none;
    transition: color var(--ease), opacity var(--ease);
}

.auth-link:hover {
    color: var(--sma-accent);
    opacity: 0.96;
}

.auth-button {
    margin-top: 6px;
    border: 0;
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    color: var(--sma-white);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    background: linear-gradient(110deg, var(--sma-primary), var(--sma-secondary));
    box-shadow:
        0 14px 30px -20px rgba(2, 93, 160, 0.95),
        0 7px 20px -14px rgba(16, 185, 129, 0.4);
    transition: transform var(--ease), box-shadow var(--ease), filter var(--ease);
}

.auth-button:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
    box-shadow:
        0 22px 36px -22px rgba(2, 93, 160, 0.92),
        0 12px 28px -18px rgba(16, 185, 129, 0.5);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-footer {
    margin: 0;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #44627d;
}

@media (max-width: 560px) {
    .auth-shell {
        padding: 16px;
    }

    .auth-card {
        border-radius: 20px;
        padding: 22px 18px;
    }

    .auth-brand {
        gap: 6px;
    }

    .auth-brand__tagline {
        font-size: 0.9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* SMA Dashboard UI */

.dashboard-page {
    background: #f8fafc;
    color: #0f172a;
}

.sma-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30;
    width: 260px;
    height: 100vh;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    background: #0f172a;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sma-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 0;
}

.sma-sidebar__logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.1rem;
    background: linear-gradient(130deg, #025da0, #39b5ff);
    box-shadow: 0 10px 24px -16px rgba(57, 181, 255, 0.88);
}

.sma-sidebar__eyebrow {
    margin: 0;
    color: #94a3b8;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 700;
}

.sma-sidebar__title {
    margin: 2px 0 0;
    color: #f8fafc;
    font-size: 1.06rem;
    font-weight: 700;
}

.sma-sidebar__nav {
    display: grid;
    gap: 6px;
}

.sma-nav-link {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.94rem;
    font-weight: 600;
    transition: background-color var(--ease), color var(--ease), transform var(--ease);
}

.sma-nav-link:hover {
    color: #ffffff;
    background: rgba(57, 181, 255, 0.16);
    transform: translateX(2px);
}

.sma-nav-link.is-active {
    color: #ffffff;
    background: linear-gradient(110deg, rgba(2, 93, 160, 0.95), rgba(57, 181, 255, 0.75));
    box-shadow: 0 12px 24px -18px rgba(57, 181, 255, 0.8);
}

.sma-nav-link--logout {
    margin-top: 8px;
    color: #fecaca;
}

.sma-nav-link--logout:hover {
    background: rgba(239, 68, 68, 0.14);
    color: #fee2e2;
}

.sma-dashboard {
    min-height: 100vh;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

.sma-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 28px;
    background: rgba(248, 250, 252, 0.88);
    border-bottom: 1px solid rgba(15, 23, 42, 0.09);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sma-topbar__title {
    margin: 0;
    font-size: clamp(1.45rem, 2.2vw, 1.9rem);
    letter-spacing: -0.02em;
    color: #0f172a;
}

.sma-topbar__subtitle {
    margin: 4px 0 0;
    color: #475569;
    font-weight: 500;
}

.sma-topbar__meta {
    display: flex;
    align-items: center;
}

.sma-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 8px 12px;
}

.sma-status-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.22);
}

.sma-main-content {
    padding: 26px 28px 34px;
    display: grid;
    gap: 24px;
}

.sma-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.sma-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 16px 32px -26px rgba(15, 23, 42, 0.42);
    transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}

.sma-card:hover {
    transform: translateY(-3px);
    border-color: rgba(57, 181, 255, 0.38);
    box-shadow: 0 24px 36px -24px rgba(2, 93, 160, 0.34);
}

.sma-card__label {
    margin: 0;
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sma-card__value {
    margin: 10px 0 8px;
    color: #0f172a;
    font-size: clamp(1.6rem, 2.2vw, 2rem);
    line-height: 1.1;
    font-weight: 800;
}

.sma-card__meta {
    margin: 0;
    color: #0f766e;
    font-size: 0.86rem;
    font-weight: 600;
}

.sma-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.sma-panel {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.07);
    padding: 20px;
    box-shadow: 0 16px 34px -30px rgba(2, 93, 160, 0.4);
}

.sma-panel__title {
    margin: 0 0 12px;
    font-size: 1.02rem;
    color: #0f172a;
}

.sma-panel__list {
    margin: 0;
    padding-left: 18px;
    color: #334155;
    display: grid;
    gap: 8px;
}

@media (max-width: 1180px) {
    .sma-sidebar {
        width: 230px;
    }

    .sma-dashboard {
        margin-left: 230px;
    }

    .sma-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .sma-sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding: 16px;
        gap: 14px;
    }

    .sma-sidebar__nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sma-dashboard {
        margin-left: 0;
    }

    .sma-topbar {
        position: static;
        padding: 16px;
    }

    .sma-main-content {
        padding: 16px;
        gap: 16px;
    }

    .sma-panels {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .sma-sidebar__nav {
        grid-template-columns: 1fr;
    }

    .sma-cards {
        grid-template-columns: 1fr;
    }
}

/* SMA Orders Module */

.sma-orders-panel {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow: 0 20px 35px -30px rgba(15, 23, 42, 0.52);
    overflow: hidden;
}

.sma-orders-toolbar {
    padding: 18px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.sma-orders-add-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 10px;
    border: 0;
    background: linear-gradient(110deg, #025da0, #39b5ff);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 14px;
    box-shadow: 0 14px 22px -16px rgba(2, 93, 160, 0.8);
    transition: transform var(--ease), box-shadow var(--ease), filter var(--ease);
}

.sma-orders-add-button:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
    box-shadow: 0 18px 28px -18px rgba(2, 93, 160, 0.84);
}

.sma-orders-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sma-orders-search,
.sma-orders-select {
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 12px;
    transition: border-color var(--ease), box-shadow var(--ease);
}

.sma-orders-search {
    width: 320px;
    max-width: 100%;
}

.sma-orders-search:focus,
.sma-orders-select:focus {
    outline: none;
    border-color: rgba(57, 181, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(57, 181, 255, 0.16);
}

.sma-orders-filter-button {
    border: 0;
    border-radius: 10px;
    background: #0f172a;
    color: #ffffff;
    font-size: 0.87rem;
    font-weight: 700;
    padding: 10px 14px;
    cursor: pointer;
    transition: background-color var(--ease), transform var(--ease);
}

.sma-orders-filter-button:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

.sma-orders-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sma-orders-table-wrap {
    overflow-x: auto;
}

.sma-orders-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

.sma-orders-table thead th {
    background: #f8fafc;
    color: #334155;
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 800;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.sma-orders-table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    font-size: 0.9rem;
    color: #1e293b;
    vertical-align: middle;
}

.sma-orders-table tbody tr:hover {
    background: rgba(57, 181, 255, 0.06);
}

.sma-orders-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sma-orders-actions a {
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    color: #025da0;
    background: rgba(2, 93, 160, 0.1);
    padding: 6px 10px;
    border-radius: 8px;
    transition: background-color var(--ease), color var(--ease);
}

.sma-orders-actions a:hover {
    color: #ffffff;
    background: #025da0;
}

.sma-orders-empty {
    text-align: center;
    color: #64748b;
    font-weight: 600;
    padding: 28px 16px !important;
}

.sma-order-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    border-radius: 999px;
    padding: 7px 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sma-order-status--pending {
    color: #92400e;
    background: #fef3c7;
}

.sma-order-status--neworder {
    color: #92400e;
    background: #fef3c7;
}

.sma-order-status--confirmed {
    color: #1d4ed8;
    background: #dbeafe;
}

.sma-order-status--delivered {
    color: #065f46;
    background: #d1fae5;
}

.sma-order-status--cancelled {
    color: #991b1b;
    background: #fee2e2;
}

.sma-order-status--noanswer {
    color: #7c3aed;
    background: #ede9fe;
}

@media (max-width: 860px) {
    .sma-orders-toolbar {
        padding: 14px;
    }

    .sma-orders-search {
        width: 100%;
    }

    .sma-orders-filters {
        width: 100%;
    }
}

/* SMA Add Order Module */

.sma-form-panel {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 20px 35px -30px rgba(15, 23, 42, 0.52);
}

.sma-form-panel__header {
    margin-bottom: 16px;
}

.sma-form-panel__title {
    margin: 0;
    color: #0f172a;
    font-size: 1.18rem;
    font-weight: 800;
}

.sma-form-panel__subtitle {
    margin: 6px 0 0;
    color: #475569;
    font-size: 0.92rem;
}

.sma-form-alert {
    margin: 0 0 12px;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

.sma-form-alert--error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.sma-form-errors {
    margin: 0 0 12px;
    padding: 10px 14px 10px 30px;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    display: grid;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
}

.sma-order-form {
    display: grid;
    gap: 18px;
}

.sma-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.sma-form-group {
    display: grid;
    gap: 8px;
}

.sma-form-group--full {
    grid-column: 1 / -1;
}

.sma-form-label {
    color: #334155;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.sma-form-input,
.sma-form-select,
.sma-form-textarea {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 500;
    padding: 11px 12px;
    transition: border-color var(--ease), box-shadow var(--ease);
}

.sma-form-textarea {
    resize: vertical;
    min-height: 92px;
}

.sma-form-input:focus,
.sma-form-select:focus,
.sma-form-textarea:focus {
    outline: none;
    border-color: rgba(57, 181, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(57, 181, 255, 0.16);
}

.sma-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.sma-order-cancel-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.15);
    background: #ffffff;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 14px;
    transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}

.sma-order-cancel-button:hover {
    background: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.25);
}

.sma-order-submit-button {
    border: 0;
    cursor: pointer;
}

@media (max-width: 860px) {
    .sma-form-panel {
        padding: 16px;
    }

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