/* Modern UI theme for Aalaya Admin */
:root {
    --font-display: "Space Grotesk", sans-serif;
    --font-body: "Spline Sans", sans-serif;
    --bg: #fbf7f2;
    --bg-accent: #f2e7dc;
    --surface: #ffffff;
    --surface-2: #fbf4ec;
    --text: #2b1c12;
    --muted: #7b5b46;
    --primary: #b36a3c;
    --primary-strong: #8d4d26;
    --accent: #f0d7bf;
    --success: #7a9b74;
    --warning: #d7a25c;
    --danger: #c2644b;
    --info: #7fa6a3;
    --ring: rgba(177, 106, 55, 0.25);
    --radius: 18px;
    --radius-sm: 12px;
    --shadow-1: 0 18px 38px rgba(15, 23, 42, 0.12);
    --shadow-2: 0 8px 22px rgba(15, 23, 42, 0.12);
    --shadow-3: 0 2px 10px rgba(15, 23, 42, 0.1);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body.app-shell {
    font-family: var(--font-body);
    color: var(--text);
    background: radial-gradient(1200px 800px at -10% -10%, #f9eee2 0%, transparent 55%),
        radial-gradient(900px 600px at 110% 10%, #f8ead7 0%, transparent 45%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 100%);
    overflow-x: hidden;
}

body.app-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(177, 106, 55, 0.08) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

#wrapper,
#content-wrapper,
#content {
    position: relative;
    z-index: 1;
}

#content-wrapper {
    background: transparent;
    width: 100%;
    overflow-x: hidden;
}

#content {
    padding: 1.5rem 1.5rem 2.5rem;
}

h1,
h2,
h3,
h4,
h5,
h6,
.sidebar-brand-text {
    font-family: var(--font-display);
    letter-spacing: -0.015em;
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-strong);
}

/* Sidebar */
.bg-gradient-primary {
    background: linear-gradient(180deg, #f9f1e8 0%, #f3e3d4 60%, #f9f1e8 100%) !important;
}

.sidebar {
    width: 240px;
    min-height: 100vh;
    box-shadow: var(--shadow-1);
    border-right: 1px solid rgba(177, 106, 55, 0.12);
}

.sidebar-brand {
    height: auto;
    padding: 1.75rem 1.25rem 1.25rem;
    text-transform: none;
    letter-spacing: 0;
}

.sidebar-brand .sidebar-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand .sidebar-brand-text {
    color: var(--primary-strong);
    font-size: 1.05rem;
}

.brand-logo {
    height: 36px;
    width: auto;
    display: block;
}

.sidebar .nav-item .nav-link {
    height: auto;
    padding: 0.75rem 1rem;
    margin: 0.15rem 0.75rem;
    width: auto;
    border-radius: 12px;
    transition: all 0.2s ease;
    color: #5a3a20;
}

.sidebar .nav-item .nav-link i {
    font-size: 0.95rem;
    margin-right: 0.5rem;
}

.sidebar .nav-item .nav-link:hover {
    background-color: rgba(177, 106, 55, 0.12);
    transform: translateX(4px);
    color: var(--text);
}

.sidebar .nav-item .nav-link.active {
    background: linear-gradient(90deg, rgba(177, 106, 55, 0.25), rgba(177, 106, 55, 0.08));
    color: var(--text);
}

.sidebar-heading {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: #a0724b;
}

.sidebar-divider {
    margin: 0.75rem 1rem;
}

#sidebarToggle {
    background-color: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.6);
}

/* Topbar */
.topbar {
    margin: 1rem 1.5rem 1.5rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(177, 106, 55, 0.12);
    box-shadow: var(--shadow-2) !important;
    position: relative;
    z-index: 1100;
}

.topbar .nav-link {
    color: var(--text);
    font-weight: 600;
}

.topbar .img-profile {
    border: 2px solid rgba(177, 106, 55, 0.35);
}

.navbar .dropdown-menu {
    border-radius: 14px;
    border: 1px solid rgba(177, 106, 55, 0.18);
    box-shadow: var(--shadow-1);
    background: rgba(255, 252, 249, 0.96);
    backdrop-filter: blur(10px);
    padding: 0.5rem;
    z-index: 2000;
}

.navbar .dropdown-menu .dropdown-item {
    border-radius: 10px;
    font-weight: 600;
    color: var(--text);
    padding: 0.5rem 0.75rem;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.navbar .dropdown-menu .dropdown-item i {
    color: var(--muted);
}

.navbar .dropdown-menu .dropdown-item:hover,
.navbar .dropdown-menu .dropdown-item:focus {
    background: rgba(177, 106, 55, 0.14);
    color: var(--primary-strong);
    transform: translateX(2px);
}

.navbar .dropdown-divider {
    border-top: 1px solid rgba(177, 106, 55, 0.15);
}

/* Cards */
.card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-3) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-2);
}

.card-header {
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    background: linear-gradient(120deg, rgba(177, 106, 55, 0.12), rgba(231, 200, 168, 0.35));
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

.card-header h6 {
    font-weight: 600;
    color: var(--text);
}

.card-header .text-primary {
    color: var(--primary) !important;
}

.border-left-primary {
    border-left: 4px solid var(--primary) !important;
}

.border-left-success {
    border-left: 4px solid var(--success) !important;
}

.border-left-info {
    border-left: 4px solid var(--info) !important;
}

.border-left-warning {
    border-left: 4px solid var(--warning) !important;
}

/* Tables */
.table-responsive {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: var(--surface);
}

.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.table.table-bordered {
    border: none;
}

.table thead th {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    border: none;
    background: transparent;
}

.table tbody tr {
    background: var(--surface-2);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.table tbody tr td {
    border: none;
    padding: 0.85rem 0.9rem;
    vertical-align: middle;
}

.table tbody tr td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.table tbody tr td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Buttons */
.btn {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.55rem 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.btn-primary {
    background: linear-gradient(120deg, var(--primary), var(--primary-strong));
    border: none;
}

.btn-success {
    background: linear-gradient(120deg, #7a9b74, #5f7f5a);
    border: none;
}

.btn-info {
    background: linear-gradient(120deg, #9fc3c0, #6e948f);
    border: none;
}

.btn-danger {
    background: linear-gradient(120deg, #d47b63, #b55841);
    border: none;
}

.btn-warning {
    background: linear-gradient(120deg, #e1b170, #c58a49);
    border: none;
    color: #1f2937;
}

.btn-secondary {
    background: #e5e7eb;
    color: #1f2937;
    border: none;
}

.btn-group .btn {
    margin-right: 0.35rem;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

.btn-block {
    width: 100%;
}

/* Badges */
.badge {
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-weight: 600;
}

.bg-success {
    background-color: rgba(122, 155, 116, 0.2) !important;
    color: #3f5b3b !important;
}

.bg-secondary {
    background-color: rgba(107, 114, 128, 0.18) !important;
    color: #374151 !important;
}

.bg-warning {
    background-color: rgba(215, 162, 92, 0.2) !important;
    color: #7a4d1f !important;
}

.bg-info {
    background-color: rgba(127, 166, 163, 0.2) !important;
    color: #335a57 !important;
}

/* Forms */
.form-control,
.form-select,
.input-group-text {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem var(--ring);
}

/* Content page editor */
.cms-empty {
    padding: 2rem 1rem;
    border: 1px dashed rgba(15, 23, 42, 0.2);
    color: var(--muted);
    text-align: center;
}

.cms-section {
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-left: 4px solid var(--primary);
    background: #fff;
}

.cms-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
    background: var(--surface-2);
}

.cms-section-header > div:first-child {
    display: flex;
    align-items: center;
    min-width: 0;
}

.cms-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-right: 0.6rem;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.cms-section-body {
    padding: 1rem;
}

.cms-subsection {
    margin-top: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
}

.cms-subrow,
.cms-media-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.cms-media-row {
    align-items: center;
}

.cms-media-row img,
.cms-media-placeholder {
    flex: 0 0 64px;
    width: 64px;
    height: 48px;
    object-fit: cover;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 6px;
}

.cms-media-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    color: var(--muted);
}

.cms-media-row .form-select {
    min-width: 0;
    flex: 2 1 240px;
}

.cms-media-row .form-control {
    min-width: 0;
    flex: 1 1 160px;
}

/* Alerts */
.alert {
    border-radius: var(--radius-sm);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--shadow-3);
}

.shadow {
    box-shadow: var(--shadow-3) !important;
}

/* Footer */
footer.sticky-footer {
    background: transparent !important;
    color: var(--muted);
}

/* Scroll to top */
.scroll-to-top {
    background: var(--primary);
    box-shadow: var(--shadow-2);
}

.scroll-to-top:hover {
    background: var(--primary-strong);
}

/* Utility color overrides */
.text-gray-800 {
    color: var(--text) !important;
}

.text-gray-600 {
    color: var(--muted) !important;
}

.text-gray-300 {
    color: rgba(123, 91, 70, 0.35) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-info {
    color: var(--info) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--danger) !important;
}

/* Animations */
@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#content .card,
#content .table-responsive,
#content .alert {
    animation: rise 0.6s ease both;
}

#content .row > [class*="col-"] {
    animation: rise 0.5s ease both;
}

#content .row > [class*="col-"]:nth-child(1) {
    animation-delay: 0.03s;
}

#content .row > [class*="col-"]:nth-child(2) {
    animation-delay: 0.08s;
}

#content .row > [class*="col-"]:nth-child(3) {
    animation-delay: 0.13s;
}

#content .row > [class*="col-"]:nth-child(4) {
    animation-delay: 0.18s;
}

/* Auth page */
body.auth-page {
    font-family: var(--font-body);
    background: radial-gradient(900px 600px at 15% 0%, #f7eadc 0%, transparent 55%),
        radial-gradient(800px 500px at 90% 20%, #f8ead7 0%, transparent 50%),
        linear-gradient(160deg, #fbf7f2 0%, #f4e9dc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-shell {
    width: min(460px, 92vw);
}

.login-card {
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--shadow-1);
}

.login-header {
    padding: 2.2rem 2rem 1.6rem;
    background: linear-gradient(120deg, rgba(177, 106, 55, 0.18), rgba(231, 200, 168, 0.4));
    text-align: center;
}

.login-logo {
    height: 56px;
    width: auto;
}

.login-header h4 {
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

.login-body {
    padding: 1.8rem 2rem 2rem;
    background: rgba(255, 255, 255, 0.9);
}

@media (max-width: 768px) {
    #content {
        padding: 1rem;
    }

    .topbar {
        margin: 0.75rem;
    }

    .sidebar {
        width: 210px;
    }

    .cms-section-header,
    .cms-subrow,
    .cms-media-row {
        align-items: stretch;
        flex-direction: column;
    }

    .cms-section-header .btn-group {
        align-self: flex-end;
    }

    .cms-subrow > .btn,
    .cms-media-row > .btn {
        align-self: flex-end !important;
    }

    .cms-media-row .form-select,
    .cms-media-row .form-control {
        width: 100%;
        flex-basis: auto;
    }
}
