/* =========================================================
   ToraMari Admin Site - Global Styles
   Path: app/admin/public/css/admin.css
   ========================================================= */

:root {
    --bg: #080c14;
    --bg-soft: #0b1220;

    --primary: #10b981;
    --primary-light: #34d399;
    --primary-dark: #047857;

    --cyan: #22d3ee;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #38bdf8;

    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-dark: #64748b;

    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);

    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    --shadow-soft: 0 14px 40px rgba(0, 0, 0, 0.22);

    --radius: 1.2rem;
    --radius-lg: 1.7rem;
    --radius-xl: 2rem;

    --container: 1220px;
    --sidebar-width: 280px;
}

/* -------------------------
   Reset
------------------------- */

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

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.14), transparent 34%),
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.08), transparent 30%),
        linear-gradient(180deg, #080c14 0%, #0b1120 48%, #050814 100%);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    display: block;
}

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

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

button {
    cursor: pointer;
}

::selection {
    background: rgba(52, 211, 153, 0.35);
    color: white;
}

/* -------------------------
   Critical Helper
------------------------- */

.hidden {
    display: none !important;
}

/* -------------------------
   Layout
------------------------- */

.container {
    width: min(100% - 2rem, var(--container));
    margin-inline: auto;
}

.page-shell {
    padding: 2rem 0 4rem;
}

.stack {
    display: grid;
    gap: 1rem;
}

.grid {
    display: grid;
    gap: 1rem;
}

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

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

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

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

/* -------------------------
   Admin App Shell
------------------------- */

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 1rem;
    background: rgba(8, 12, 20, 0.82);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    overflow-y: auto;
}

.admin-main {
    min-width: 0;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.3rem;
    background: rgba(8, 12, 20, 0.76);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.admin-content {
    padding: 1.3rem;
}

/* -------------------------
   Brand + Sidebar
------------------------- */

.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    margin-bottom: 1rem;
}

.admin-brand-badge,
.brand-badge {
    width: 44px;
    height: 44px;
    border-radius: 1rem;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: white;
    box-shadow: 0 16px 34px rgba(16, 185, 129, 0.28);
    font-weight: 900;
}

.sidebar-section-label {
    display: block;
    margin: 1.1rem 0 0.5rem;
    color: var(--muted-dark);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.sidebar-nav {
    display: grid;
    gap: 0.45rem;
}

.sidebar-link {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem 0.9rem;
    border-radius: 1rem;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 800;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(52, 211, 153, 0.2);
    transform: translateY(-1px);
}

.sidebar-link.active {
    background: rgba(16, 185, 129, 0.11);
}

/* -------------------------
   Glass Surfaces
------------------------- */

.glass,
.glass-strong,
.card,
.surface {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.glass {
    border-radius: var(--radius-lg);
}

.glass-strong {
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.55));
    border: 1px solid var(--border-strong);
}

.card {
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.surface {
    border-radius: var(--radius-lg);
    padding: 1.4rem;
}

/* -------------------------
   Buttons
------------------------- */

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.8rem 1rem;
    border-radius: 1rem;
    border: 1px solid transparent;
    font-size: 0.88rem;
    font-weight: 900;
    line-height: 1;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease,
        opacity 0.18s ease;
}

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

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.62;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    color: white;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    border-color: rgba(52, 211, 153, 0.3);
    box-shadow: 0 16px 34px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 20px 46px rgba(16, 185, 129, 0.28);
}

.btn-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.085);
    border-color: rgba(52, 211, 153, 0.22);
}

.btn-danger {
    color: white;
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.22);
}

.btn-warning {
    color: #fff7ed;
    background: rgba(251, 191, 36, 0.14);
    border-color: rgba(251, 191, 36, 0.3);
}

.btn-warning:hover {
    background: rgba(251, 191, 36, 0.22);
}

/* -------------------------
   Typography
------------------------- */

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary-light);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.page-title {
    margin: 0.8rem 0 0.7rem;
    font-size: clamp(2.2rem, 4.6vw, 4.5rem);
    line-height: 0.98;
    letter-spacing: -0.07em;
    font-weight: 900;
}

.page-subtitle {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.8;
}

.panel-title {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.muted {
    color: var(--muted);
}

.footer-note {
    color: var(--muted-dark);
    font-size: 0.82rem;
}

/* -------------------------
   Forms
------------------------- */

.input,
select.input,
textarea.input {
    width: 100%;
    min-height: 52px;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    outline: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.input::placeholder,
textarea.input::placeholder {
    color: rgba(148, 163, 184, 0.72);
}

.input:focus,
select.input:focus,
textarea.input:focus {
    border-color: rgba(52, 211, 153, 0.55);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
    background: rgba(255, 255, 255, 0.075);
}

textarea.input {
    min-height: 130px;
    resize: vertical;
}

select.input {
    appearance: none;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-help {
    color: var(--muted-dark);
    font-size: 0.82rem;
    line-height: 1.6;
    margin: 0.45rem 0 0;
}

/* -------------------------
   Stats
------------------------- */

.stat-label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--muted-dark);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.stat-value {
    color: var(--text);
    font-size: clamp(1.7rem, 3.8vw, 2.35rem);
    line-height: 1;
    letter-spacing: -0.06em;
    font-weight: 900;
}

.stat-help {
    margin: 0.8rem 0 0;
    color: var(--muted-dark);
    font-size: 0.82rem;
    line-height: 1.5;
}

/* -------------------------
   Badges
------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    font-size: 0.68rem;
    line-height: 1;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-success {
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.13);
    border-color: rgba(16, 185, 129, 0.24);
}

.badge-info {
    color: #bae6fd;
    background: rgba(56, 189, 248, 0.13);
    border-color: rgba(56, 189, 248, 0.25);
}

.badge-warning {
    color: #fde68a;
    background: rgba(251, 191, 36, 0.13);
    border-color: rgba(251, 191, 36, 0.28);
}

.badge-danger {
    color: #fecaca;
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(248, 113, 113, 0.3);
}

/* -------------------------
   Notices
------------------------- */

.notice {
    padding: 1rem;
    border-radius: 1.1rem;
    color: #d1fae5;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    line-height: 1.65;
}

.notice-warning {
    color: #fde68a;
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.22);
}

.notice-danger {
    color: #fecaca;
    background: rgba(248, 113, 113, 0.11);
    border-color: rgba(248, 113, 113, 0.25);
}

/* -------------------------
   Tables
------------------------- */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.95rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: top;
}

.table th {
    color: var(--muted-dark);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.13em;
}

.table td {
    color: var(--text);
    font-size: 0.9rem;
}

.table tr:last-child td {
    border-bottom: 0;
}

/* -------------------------
   Cards / Lists
------------------------- */

.list {
    display: grid;
    gap: 0.85rem;
}

.list-item {
    padding: 1rem;
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.empty-state {
    padding: 1.4rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.035);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    color: var(--muted);
    text-align: center;
}

.error-text {
    color: var(--danger);
}

.success-text {
    color: var(--primary-light);
}

/* -------------------------
   Loading
------------------------- */

.page-loading,
.processing-overlay,
.modal-backdrop {
    animation: fadeIn 0.18s ease both;
}

.page-loading {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    background: rgba(8, 12, 20, 0.95);
    backdrop-filter: blur(16px);
}

.loading-box {
    text-align: center;
}

.spinner {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 4px solid rgba(16, 185, 129, 0.18);
    border-top-color: #10b981;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* -------------------------
   Scrollbar
------------------------- */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.035);
}

::-webkit-scrollbar-thumb {
    background: rgba(52, 211, 153, 0.35);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 211, 153, 0.55);
}

/* -------------------------
   Responsive
------------------------- */

@media (max-width: 1100px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: relative;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

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

@media (max-width: 760px) {
    .container {
        width: min(100% - 1rem, var(--container));
    }

    .admin-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-content {
        padding: 1rem 0.5rem;
    }

    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .row-between {
        align-items: flex-start;
        flex-direction: column;
    }

    .surface,
    .card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.85rem;
    }

    .btn {
        width: 100%;
    }
}