:root {
    --bg: #ffffff;
    --bg-deep: #f5f8fd;
    --bg-soft: #edf3fb;
    --card: rgba(255, 255, 255, 0.96);
    --card-strong: rgba(255, 255, 255, 0.99);
    --card-border: rgba(56, 89, 138, 0.14);
    --line: rgba(56, 89, 138, 0.12);
    --text: #162746;
    --muted: #5f7598;
    --accent: #5f7fae;
    --accent-strong: #38598a;
    --success: #82c9b6;
    --danger: #f29ab0;
    --shadow: 0 24px 56px rgba(27, 52, 92, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100dvh;
    font-family: "Cairo", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(95, 127, 174, 0.12), transparent 24%),
        radial-gradient(circle at bottom left, rgba(136, 164, 207, 0.14), transparent 20%),
        linear-gradient(180deg, #ffffff 0%, #f7faff 52%, #f2f7fd 100%);
}

body.landing-page {
    overflow: hidden;
}

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

button,
input {
    font: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.page-shell {
    position: relative;
    min-height: 100dvh;
    padding: 18px;
    overflow: hidden;
}

.page-shell-centered,
.centered-shell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(14px);
    opacity: 0.9;
    pointer-events: none;
}

.orb-one {
    top: -80px;
    right: -40px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(116, 145, 192, 0.2), transparent 68%);
}

.orb-two {
    bottom: -110px;
    left: -70px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(85, 118, 171, 0.16), transparent 70%);
}

.orb-three {
    top: 16%;
    left: 8%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(150, 178, 219, 0.12), transparent 70%);
}

.floating-link,
.back-link {
    position: absolute;
    top: 28px;
    left: 28px;
    z-index: 3;
}

.ghost-link,
.secondary-button,
.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 16px;
}

.ghost-link,
.secondary-button {
    padding: 12px 18px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text);
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.ghost-link:hover,
.secondary-button:hover {
    transform: translateY(-2px);
    border-color: rgba(154, 184, 226, 0.36);
    background: rgba(95, 127, 174, 0.08);
}

.form-stage,
.login-stage {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 700px;
    display: grid;
    justify-items: center;
    gap: 14px;
}

.ramtan-logo {
    width: min(100%, 220px);
    filter: drop-shadow(0 14px 30px rgba(2, 8, 20, 0.18));
}

.logo-small {
    width: min(100%, 190px);
}

.hero-card,
.login-card,
.glass-panel,
.stat-card {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--card-border);
    background: linear-gradient(180deg, var(--card-strong) 0%, var(--card) 100%);
    border-radius: 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.hero-card,
.login-card,
.glass-panel {
    padding: 20px;
}

.centered-card {
    max-width: 700px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    text-align: right;
}

.card-head-content {
    flex: 1;
    min-width: 0;
}

.card-head-logo {
    width: min(100%, 150px);
    flex: 0 0 auto;
}

.popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(12, 28, 56, 0.28);
    backdrop-filter: blur(6px);
}

.popup-backdrop.is-visible {
    display: flex;
}

.popup-card {
    width: min(100%, 460px);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    background: linear-gradient(180deg, var(--card-strong) 0%, var(--card) 100%);
    box-shadow: 0 28px 70px rgba(18, 35, 67, 0.18);
    padding: 22px;
}

.popup-card-success {
    text-align: center;
}

.popup-card-success h2,
.popup-card-form h2 {
    margin: 0 0 8px;
}

.popup-card-success p,
.popup-card-form p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.popup-icon {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: rgba(130, 201, 182, 0.14);
    color: #5da48f;
    font-size: 1.8rem;
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--text);
    cursor: pointer;
}

.dashboard-layout-single {
    grid-template-columns: 1fr;
}

.body-locked {
    overflow: hidden;
}

.card-head h1,
.card-head h2,
.section-head h1,
.password-panel h2 {
    margin: 10px 0 8px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.card-head h1,
.section-head h1 {
    font-size: clamp(1.65rem, 3vw, 2.45rem);
}

.section-pill,
.eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    color: var(--muted);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.section-pill::before,
.section-pill::after,
.eyebrow::before {
    content: "";
    width: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(168, 187, 217, 0.8), transparent);
}

.subtle-copy,
.login-card p,
.password-panel p,
.empty-state p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    font-size: 0.95rem;
}

.copy-main,
.copy-sub,
.label-main,
.label-sub {
    display: block;
}

.copy-sub,
.label-sub,
.stat-sub,
.th-sub {
    unicode-bidi: plaintext;
}

.copy-sub {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.85rem;
}

.styled-form {
    display: grid;
    min-width: 0;
    gap: 12px;
}

.dual-grid,
.stats-grid {
    display: grid;
    gap: 12px;
}

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

.input-group {
    display: grid;
    min-width: 0;
    gap: 8px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid var(--card-border);
    background: #f8fbff;
}

.dual-grid > * {
    min-width: 0;
}

.input-group label {
    display: grid;
    gap: 2px;
    color: var(--text);
    font-weight: 700;
    font-size: 0.9rem;
}

.label-sub {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.label-main,
.label-sub,
.copy-main,
.copy-sub {
    overflow-wrap: anywhere;
}

.input-group input,
.search-box input {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(153, 177, 212, 0.2);
    border-radius: 14px;
    padding: 12px 14px;
    background: #ffffff;
    color: var(--text);
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    -webkit-appearance: none;
    appearance: none;
}

.input-group input::placeholder,
.search-box input::placeholder {
    color: rgba(168, 187, 217, 0.78);
}

.input-group input:focus,
.search-box input:focus {
    border-color: rgba(140, 171, 219, 0.65);
    box-shadow: 0 0 0 4px rgba(95, 127, 174, 0.16);
    background: #ffffff;
}

.input-group small {
    color: var(--danger);
}

.has-error {
    border-color: rgba(242, 154, 176, 0.24);
    background: rgba(242, 154, 176, 0.05);
}

.has-error input {
    border-color: rgba(242, 154, 176, 0.38);
}

.primary-button,
.secondary-button {
    border: 0;
    cursor: pointer;
}

.primary-button {
    min-height: 48px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 18px 34px rgba(34, 59, 103, 0.34);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 36px rgba(34, 59, 103, 0.4);
}

.compact {
    padding: 13px 18px;
}

.alert {
    width: 100%;
    padding: 14px 16px;
    border-radius: 18px;
    margin-bottom: 12px;
}

.alert.success {
    background: rgba(130, 201, 182, 0.12);
    border: 1px solid rgba(130, 201, 182, 0.28);
    color: #d8f6ec;
}

.alert.error {
    background: rgba(242, 154, 176, 0.1);
    border: 1px solid rgba(242, 154, 176, 0.24);
    color: #ffe3ea;
}

.topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.brand-with-logo span {
    display: grid;
    gap: 4px;
}

.brand strong {
    font-size: 1.12rem;
}

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

.brand-logo {
    width: min(100%, 190px);
}

.dashboard-layout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr);
    gap: 24px;
}

.dashboard-main,
.dashboard-side {
    display: grid;
    gap: 24px;
    min-width: 0;
}

.section-head,
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.section-head h1 {
    margin-top: 8px;
}

.action-cluster,
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

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

.stat-card {
    padding: 24px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 6px;
}

.stat-sub {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 10px;
}

.stat-card strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.9rem, 3vw, 2.6rem);
}

.toolbar {
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.search-box {
    position: relative;
    flex: 1;
}

.search-box i {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    color: var(--muted);
}

.search-box input {
    padding-right: 46px;
}

.table-wrap {
    overflow: auto;
    border-radius: 22px;
    border: 1px solid var(--line);
}

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

thead {
    background: #f5f8fd;
}

th,
td {
    padding: 16px;
    text-align: right;
    border-bottom: 1px solid var(--line);
}

.th-main {
    display: block;
    white-space: nowrap;
}

.th-sub {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 2px;
}

tbody tr:hover {
    background: #f8fbff;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 240px;
    text-align: center;
    gap: 10px;
}

.empty-state i {
    font-size: 2.5rem;
    color: rgba(168, 187, 217, 0.9);
}

.password-panel {
    position: sticky;
    top: 24px;
}

@media (max-width: 1100px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .password-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .page-shell {
        padding: 8px;
    }

    .floating-link,
    .back-link {
        top: 18px;
        left: 20px;
    }

    .stats-grid,
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

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

    .hero-card,
    .login-card,
    .glass-panel,
    .stat-card {
        padding: 12px;
    }

    .topbar,
    .section-head,
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions,
    .toolbar-actions,
    .action-cluster {
        justify-content: stretch;
    }

    .ghost-link,
    .secondary-button,
    .primary-button {
        width: 100%;
    }

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

    .brand-logo {
        width: min(100%, 170px);
    }

    .ramtan-logo {
        width: min(100%, 155px);
    }

    .logo-small {
        width: min(100%, 145px);
    }

    .card-head-logo {
        width: min(100%, 112px);
    }

    .card-head h1,
    .section-head h1 {
        font-size: clamp(1.02rem, 4.8vw, 1.3rem);
        margin: 4px 0;
    }

    .subtle-copy,
    .login-card p,
    .password-panel p,
    .empty-state p {
        display: none;
    }

    .input-group label {
        font-size: 0.76rem;
    }

    .input-group input,
    .search-box input,
    .primary-button {
        min-height: 38px;
        font-size: 0.86rem;
    }

    .input-group {
        gap: 5px;
        padding: 7px;
        border-radius: 14px;
    }

    .input-group input,
    .search-box input {
        padding: 9px 10px;
        border-radius: 10px;
    }

    .styled-form {
        gap: 8px;
    }

    .section-pill {
        display: none;
    }

    .card-head {
        gap: 8px;
        align-items: flex-start;
        margin-bottom: 8px;
    }

    .card-head-logo {
        width: min(100%, 82px);
    }

    .popup-card {
        padding: 16px;
        border-radius: 22px;
    }

    .modal-head {
        gap: 10px;
        margin-bottom: 12px;
    }
}

@media (max-width: 420px) {
    .page-shell {
        padding: 6px;
    }

    .card-head {
        gap: 6px;
    }

    .card-head h1,
    .section-head h1 {
        font-size: 1rem;
    }

    .card-head-logo {
        width: min(100%, 72px);
    }

    .dual-grid {
        gap: 6px;
    }

    .input-group label {
        font-size: 0.72rem;
    }

    .label-sub {
        font-size: 0.68rem;
    }
}

@media (max-height: 860px) {
    .page-shell {
        padding: 12px;
    }

    .form-stage,
    .login-stage {
        gap: 10px;
    }

    .ramtan-logo {
        width: min(100%, 190px);
    }

    .logo-small {
        width: min(100%, 165px);
    }

    .card-head-logo {
        width: min(100%, 120px);
    }

    .hero-card,
    .login-card,
    .glass-panel {
        padding: 14px;
    }

    .card-head {
        margin-bottom: 10px;
    }

    .card-head h1,
    .section-head h1 {
        font-size: clamp(1.45rem, 3vw, 2.1rem);
        margin: 6px 0 4px;
    }

    .section-pill,
    .eyebrow {
        font-size: 0.78rem;
    }

    .subtle-copy {
        line-height: 1.4;
    }

    .styled-form {
        gap: 10px;
    }

    .dual-grid,
    .stats-grid {
        gap: 10px;
    }

    .input-group {
        padding: 9px;
    }

    .input-group label {
        font-size: 0.84rem;
    }

    .input-group input,
    .search-box input,
    .primary-button {
        min-height: 38px;
    }
}

@media (max-height: 720px) {
    .page-shell {
        padding: 6px;
    }

    .form-stage {
        gap: 6px;
    }

    .ramtan-logo {
        width: min(100%, 120px);
    }

    .logo-small {
        width: min(100%, 110px);
    }

    .card-head-logo {
        width: min(100%, 92px);
    }

    .subtle-copy {
        display: none;
    }

    .section-pill {
        display: none;
    }

    .card-head h1,
    .section-head h1 {
        font-size: clamp(1.05rem, 3vw, 1.45rem);
        margin: 2px 0;
    }

    .hero-card,
    .login-card,
    .glass-panel {
        padding: 10px;
    }

    .card-head {
        margin-bottom: 6px;
    }

    .styled-form {
        gap: 6px;
    }

    .dual-grid,
    .stats-grid {
        gap: 6px;
    }

    .input-group {
        gap: 4px;
        padding: 6px;
    }

    .input-group input,
    .search-box input,
    .primary-button {
        min-height: 32px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .input-group label {
        font-size: 0.7rem;
    }
}
