/* BEROYA Global Dark Theme */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body.beroya-body {
    direction: rtl;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top, #1d1f2a 0, #05060a 50%, #020308 100%);
    color: #f5f5f7;
    min-height: 100vh;
}

body.beroya-body.beroya-sidebar-open {
    overflow: hidden;
}

.beroya-app {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(8, 10, 20, 0.96), rgba(10, 8, 24, 0.98));
}

.beroya-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.beroya-content {
    padding: 1.5rem 2rem 1.5rem 1.5rem;
    min-height: calc(100vh - 64px - 48px);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Sidebar */
.beroya-sidebar {
    width: 260px;
    background: radial-gradient(circle at top right, #171925, #050611 65%);
    border-left: 1px solid rgba(255, 215, 128, 0.12);
    box-shadow: -18px 0 40px rgba(0, 0, 0, 0.8);
    padding: 1.25rem 1rem 1.5rem;
    position: sticky;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 40;
}

.beroya-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(2px);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.beroya-sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.beroya-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.beroya-sidebar-close {
    display: none;
}

.beroya-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.beroya-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: contain;
    background: radial-gradient(circle at 30% 0, #ffe7a3, #c2923a 45%, #7e5a1e 100%);
    padding: 3px;
    box-shadow: 0 0 18px rgba(255, 204, 102, 0.5);
}

.beroya-logo-text {
    font-weight: 700;
    letter-spacing: 0.16em;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #f9f4e8;
}

.beroya-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 0.5rem;
}

.beroya-sidebar-section-title {
    margin: 0.75rem 0 0.3rem;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.beroya-sidebar-section-title-finance {
    color: rgba(200, 200, 225, 0.7);
}

.beroya-sidebar-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.8rem;
    color: rgba(244, 244, 250, 0.76);
    text-decoration: none;
    font-size: 0.86rem;
    transition: background 0.2s ease, transform 0.16s ease, box-shadow 0.2s ease, color 0.16s ease;
}

.beroya-sidebar-link .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 0.9rem;
    background: radial-gradient(circle at 30% 0, rgba(255, 232, 177, 0.35), rgba(159, 124, 49, 0.06));
    color: #f8d47a;
    font-size: 1.1rem;
}

.beroya-sidebar-link .label {
    flex: 1;
}

.beroya-sidebar-link:hover {
    background: radial-gradient(circle at right, rgba(255, 222, 160, 0.32), rgba(10, 10, 22, 0.95));
    box-shadow: -6px 8px 24px rgba(0, 0, 0, 0.65);
    transform: translateY(-1px);
    color: #fffaf0;
}

.beroya-sidebar-link.is-active {
    background: linear-gradient(120deg, rgba(255, 211, 135, 0.08), rgba(255, 196, 77, 0.18));
    border: 1px solid rgba(255, 207, 102, 0.65);
    box-shadow: 0 0 22px rgba(255, 206, 122, 0.45);
}

.beroya-sidebar-link.is-active .icon {
    background: radial-gradient(circle at 20% 0, #ffe9b5, #e1ac45 40%, #82561c 100%);
    color: #201406;
}

.beroya-sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.beroya-sidebar-group-toggle {
    justify-content: space-between;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: inherit;
    color: inherit;
    cursor: pointer;
}

.beroya-sidebar-group-toggle:focus {
    outline: none;
}

.beroya-sidebar-group-toggle .chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.beroya-sidebar-group-items {
    display: none;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 0.2rem;
    padding-right: 0.75rem;
}

.beroya-sidebar-group-items.is-open {
    display: flex;
}

.beroya-sidebar-sub-link {
    display: block;
    padding: 0.4rem 0.7rem;
    border-radius: 0.75rem;
    color: rgba(244, 244, 250, 0.78);
    text-decoration: none;
    font-size: 0.8rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.beroya-sidebar-sub-link:hover {
    background: rgba(255, 222, 160, 0.12);
    color: #fffaf0;
}

.beroya-sidebar-sub-link.is-active {
    background: rgba(255, 207, 122, 0.2);
    color: #fffaf0;
}

/* Navbar */
.beroya-navbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: radial-gradient(circle at top, rgba(23, 21, 36, 0.94), rgba(3, 3, 10, 0.98));
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 30;
}

.beroya-navbar-left,
.beroya-navbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.beroya-icon-button {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: radial-gradient(circle at 25% 0, rgba(255, 240, 190, 0.25), rgba(9, 9, 20, 0.9));
    color: #f8f4e8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.beroya-icon-button:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 0 18px rgba(255, 209, 116, 0.4);
    border-color: rgba(255, 207, 122, 0.9);
}

.beroya-breadcrumb {
    font-size: 0.82rem;
    color: rgba(244, 244, 250, 0.7);
}

.beroya-navbar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.beroya-navbar-user .info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.78rem;
}

.beroya-navbar-user .name {
    font-weight: 600;
}

.beroya-navbar-user .role {
    color: rgba(255, 255, 255, 0.6);
}

.beroya-navbar-user .avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: radial-gradient(circle at 0 0, #ffe5ae, #c7902f 45%, #7f5416 100%);
    color: #1a1308;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.beroya-navbar-item.beroya-notification {
    position: relative;
    cursor: pointer;
    padding: 0.25rem 0.35rem;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.82);
    transition: background 0.15s ease;
}

.beroya-navbar-item.beroya-notification .badge {
    position: absolute;
    top: -2px;
    left: -2px;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    background: linear-gradient(120deg, #ff6961, #ffb347);
    color: #150b02;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer */
.beroya-footer {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    font-size: 0.78rem;
    color: rgba(235, 235, 250, 0.65);
    border-top: 1px solid rgba(255, 255, 255, 0.055);
    background: linear-gradient(180deg, rgba(7, 7, 16, 0.96), rgba(3, 3, 10, 0.98));
}

.beroya-footer-meta {
    color: rgba(255, 207, 122, 0.7);
}

/* Cards / Glass */
.beroya-card {
    background: radial-gradient(circle at top, rgba(255, 243, 209, 0.06), rgba(16, 16, 30, 0.95));
    border-radius: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.085);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.85);
    padding: 1.1rem 1.2rem;
}

.beroya-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.beroya-card-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.beroya-card-subtitle {
    font-size: 0.78rem;
    color: rgba(235, 235, 250, 0.72);
}

.beroya-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.beroya-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.beroya-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.beroya-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.beroya-grid-fluid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.beroya-kpi-card {
    position: relative;
    padding: 1rem 1rem 0.9rem;
    border-radius: 1rem;
    background: radial-gradient(circle at top left, rgba(250, 220, 140, 0.2), rgba(4, 5, 12, 0.98));
    border: 1px solid rgba(255, 215, 128, 0.32);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.beroya-kpi-label {
    font-size: 0.78rem;
    color: rgba(255, 248, 225, 0.82);
}

.beroya-kpi-value {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 0.15rem;
}

.beroya-kpi-trend {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: rgba(162, 255, 193, 0.9);
}

.beroya-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.73rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Tables & Forms */
.beroya-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.beroya-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.beroya-table thead {
    background: linear-gradient(90deg, rgba(24, 24, 40, 0.98), rgba(10, 10, 24, 0.98));
}

.beroya-table th,
.beroya-table td {
    padding: 0.6rem 0.75rem;
    white-space: nowrap;
}

.beroya-table th {
    text-align: right;
    font-weight: 600;
    color: rgba(253, 244, 220, 0.9);
}

.beroya-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.012);
}

.beroya-table tbody tr:hover {
    background: radial-gradient(circle at center, rgba(255, 225, 165, 0.08), rgba(6, 6, 18, 0.96));
}

.beroya-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
}

.beroya-status-available {
    background: rgba(157, 255, 177, 0.12);
    color: #b7ffce;
}

.beroya-status-reserved {
    background: rgba(255, 227, 160, 0.12);
    color: #ffe9b0;
}

.beroya-status-sold {
    background: rgba(255, 171, 171, 0.12);
    color: #ffc5c5;
}

.beroya-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.beroya-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.beroya-label {
    font-size: 0.78rem;
    color: rgba(244, 244, 255, 0.85);
}

.beroya-input,
.beroya-select,
.beroya-textarea {
    border-radius: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.03), rgba(6, 6, 18, 0.98));
    color: #f6f6ff;
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.beroya-input:focus,
.beroya-select:focus,
.beroya-textarea:focus {
    border-color: rgba(255, 207, 122, 0.85);
    box-shadow: 0 0 0 1px rgba(255, 215, 140, 0.6);
}

/* Dark-mode dropdown styling for selects */
.beroya-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #05060a;
    background-image: radial-gradient(circle at top, rgba(255, 255, 255, 0.03), rgba(6, 6, 18, 0.98));
    color: #f6f6ff;
}

.beroya-select option,
.beroya-select optgroup {
    background-color: #05060a;
    color: #f6f6ff;
}

.beroya-select option:checked,
.beroya-select option:hover {
    background-color: #171925;
    color: #fffaf0;
}

.beroya-textarea {
    min-height: 90px;
    resize: vertical;
}

.beroya-switch {
    position: relative;
    width: 42px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: background 0.15s ease;
}

.beroya-switch-thumb {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 0 0, #ffe7b8, #dda741 40%, #7b4f17 100%);
    transition: transform 0.18s ease;
}

.beroya-switch.is-on {
    background: rgba(184, 255, 205, 0.45);
}

.beroya-switch.is-on .beroya-switch-thumb {
    transform: translateX(-20px);
}

/* Buttons */
.beroya-btn {
    border-radius: 999px;
    border: 1px solid rgba(255, 207, 122, 0.7);
    padding: 0.45rem 1.15rem;
    font-size: 0.82rem;
    background: linear-gradient(135deg, #ffe7b0, #f2b544);
    color: #1b1309;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.12s ease;
}

.beroya-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(255, 206, 122, 0.55);
    filter: brightness(1.03);
}

.beroya-btn-secondary {
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.06), rgba(9, 9, 18, 0.98));
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(248, 248, 255, 0.9);
}

.beroya-btn-danger {
    background: linear-gradient(135deg, #ff9a9e, #ff6a6a);
    border-color: rgba(255, 130, 130, 0.8);
    color: #1b0506;
}

/* Auth */
.beroya-auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.beroya-auth-wrapper {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.beroya-auth-card {
    width: 100%;
    max-width: 420px;
    background: radial-gradient(circle at top, rgba(255, 245, 212, 0.15), rgba(7, 7, 17, 0.98));
    border-radius: 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
    padding: 2rem 2rem 1.75rem;
}

.beroya-auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.beroya-auth-logo img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 0, #ffe9b5, #e4b149 45%, #84561b 100%);
    padding: 4px;
}

.beroya-auth-title {
    text-align: center;
    margin: 0 0 0.3rem;
    font-size: 1.2rem;
}

.beroya-auth-subtitle {
    text-align: center;
    margin: 0 0 1.25rem;
    font-size: 0.82rem;
    color: rgba(235, 235, 250, 0.78);
}

.beroya-auth-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.beroya-alert {
    border-radius: 0.9rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.beroya-alert-success {
    background: rgba(157, 255, 177, 0.08);
    border: 1px solid rgba(157, 255, 177, 0.4);
    color: #b7ffce;
}

.beroya-alert-error {
    background: rgba(255, 171, 171, 0.08);
    border: 1px solid rgba(255, 171, 171, 0.4);
    color: #ffc5c5;
}

.beroya-empty-state {
    text-align: center;
    padding: 0.9rem 0.5rem;
    font-size: 0.8rem;
    color: rgba(230, 230, 245, 0.7);
}

/* Animations */
.animate-fade-in {
    animation: beroyaFadeIn 0.4s ease-out;
}

.animate-slide-in-right {
    animation: beroyaSlideInRight 0.35s ease-out;
}

@keyframes beroyaFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes beroyaSlideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 992px), (hover: none) and (pointer: coarse) {
    /* On mobile, the sidebar uses drawer-style transform; avoid conflicting load animation */
    .beroya-sidebar.animate-slide-in-right {
        animation: none;
    }

    .beroya-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100vw !important;
        max-width: 100vw !important;
        border-left: 0;
        box-shadow: none;
        border-radius: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(100vw);
        transition: transform 0.25s ease;
    }

    .beroya-sidebar-backdrop {
        display: block;
    }

    .beroya-sidebar.is-open {
        transform: translateX(0);
    }

    .beroya-app {
        padding-right: 0;
    }

    .beroya-sidebar-close {
        display: inline-flex;
    }
}

@media (max-width: 768px) {
    .beroya-content {
        padding-inline: 1rem;
    }

    .beroya-grid-4,
    .beroya-grid-3,
    .beroya-grid-2 {
        grid-template-columns: 1fr;
    }

    .beroya-page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
