/*======================================================================*\
|| #################################################################### ||
|| #                         NEDAL SOFTWARE                            # ||
|| # ---------------------------------------------------------------- # ||
|| # Developed by: Nedal Hussein Al Masseri                           # ||
|| # Website: https://www.almasseri.net                               # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright © 2026 Nedal Hussein Al Masseri                        # ||
|| # All Rights Reserved.                                             # ||
|| #                                                                  # ||
|| # Unauthorized copying, modification, redistribution, or resale    # ||
|| # is strictly prohibited without prior written permission.         # ||
|| #################################################################### ||
\*======================================================================*/

:root {
    --bg: #f5f8fc;
    --surface: #ffffff;
    --surface-soft: #eef4fb;
    --border: #dbe5f0;
    --text: #122033;
    --muted: #64748b;
    --primary: #0b4ea2;
    --primary-dark: #08396f;
    --success: #16814b;
    --danger: #c0392b;
    --shadow: 0 10px 30px rgba(24, 45, 75, 0.08);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html {
    direction: rtl;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Tajawal", Arial, Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
    background: linear-gradient(180deg, #082f5f 0%, #0b4ea2 100%);
    color: #fff;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.12);
    font-size: 22px;
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    font-size: 18px;
}

.brand span {
    margin-top: 3px;
    font-size: 13px;
    opacity: 0.76;
}

.sidebar-nav {
    margin-top: 22px;
    display: grid;
    gap: 7px;
}

.nav-item {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 12px;
    transition: 0.18s ease;
}

.nav-item:hover,
.nav-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.main-content {
    min-width: 0;
    padding: 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.topbar h1,
.topbar p,
.section-header h2,
.section-header p {
    margin: 0;
}

.topbar h1 {
    font-size: 28px;
}

.topbar p,
.section-header p {
    margin-top: 6px;
    color: var(--muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: #e9f8f0;
    color: var(--success);
    font-weight: 700;
    font-size: 14px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(22, 129, 75, 0.12);
}

.icon-button,
.secondary-button,
.action-card {
    border: 0;
    cursor: pointer;
}

.icon-button {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

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

.stat-card,
.panel-section {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.stat-card {
    padding: 20px;
}

.stat-label,
.stat-description {
    display: block;
}

.stat-label {
    color: var(--muted);
    font-size: 14px;
}

.stat-value {
    display: block;
    margin: 10px 0 6px;
    font-size: 30px;
}

.stat-value.small {
    font-size: 24px;
}

.stat-value.success {
    color: var(--success);
}

.stat-description {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.panel-section {
    margin-top: 18px;
    padding: 22px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-header h2 {
    font-size: 20px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.action-card {
    text-align: right;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    padding: 18px;
    border-radius: 14px;
    color: var(--text);
    transition: 0.18s ease;
}

.action-card:hover {
    transform: translateY(-2px);
    border-color: #b8cce2;
}

.action-card.danger {
    background: #fff2f0;
    border-color: #f1cbc6;
}

.action-card strong,
.action-card small {
    display: block;
}

.action-card strong {
    margin: 10px 0 5px;
}

.action-card small {
    color: var(--muted);
    line-height: 1.6;
}

.action-icon {
    font-size: 24px;
}

.secondary-button {
    background: var(--surface-soft);
    color: var(--primary);
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 38px 18px;
    border: 1px dashed #c6d4e4;
    border-radius: 14px;
    background: #fbfdff;
}

.empty-state strong,
.empty-state p {
    display: block;
}

.empty-state strong {
    margin-top: 10px;
}

.empty-state p {
    margin: 7px 0 0;
    color: var(--muted);
}

.empty-icon {
    font-size: 32px;
}

@media (max-width: 1050px) {
    .dashboard-grid,
    .quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
    }

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

    .main-content {
        padding: 18px;
    }

    .topbar,
    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-grid,
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

.nav-group {
    border-radius: 12px;
    overflow: hidden;
}

.nav-group-title {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255, 255, 255, 0.88);
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.18s ease;
}

.nav-group-title::-webkit-details-marker {
    display: none;
}

.nav-group-title:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}

.nav-arrow {
    font-size: 16px;
    transition: transform 0.18s ease;
}

.nav-group[open] .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    display: grid;
    gap: 5px;
    padding: 4px 8px 8px;
}

.nav-subitem {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    transition: 0.18s ease;
}

.nav-subitem:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top right, rgba(11, 78, 162, 0.16), transparent 34%),
        linear-gradient(135deg, #eef4fb 0%, #f8fbff 100%);
}

.login-card {
    width: min(100%, 430px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(24, 45, 75, 0.14);
    padding: 28px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.login-brand strong,
.login-brand span {
    display: block;
}

.login-brand strong {
    font-size: 19px;
}

.login-brand span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.login-heading {
    margin: 24px 0 18px;
}

.login-heading h1,
.login-heading p {
    margin: 0;
}

.login-heading h1 {
    font-size: 25px;
}

.login-heading p {
    margin-top: 7px;
    color: var(--muted);
    line-height: 1.7;
}

.login-error {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #f1cbc6;
    border-radius: 12px;
    background: #fff2f0;
    color: var(--danger);
    font-weight: 700;
    font-size: 14px;
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-form label {
    display: grid;
    gap: 7px;
}

.login-form label span {
    font-size: 14px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fbfdff;
    color: var(--text);
    outline: none;
    transition: 0.18s ease;
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(11, 78, 162, 0.10);
}

.login-form button {
    margin-top: 4px;
    border: 0;
    border-radius: 12px;
    padding: 13px 16px;
    background: linear-gradient(135deg, var(--primary), #1675d1);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 14px;
    border-radius: 12px;
    background: var(--surface);
    color: var(--danger);
    text-decoration: none;
    font-weight: 700;
    box-shadow: var(--shadow);
    transition: 0.18s ease;
}

.logout-button:hover {
    background: #fff2f0;
}
