:root {
    --rd-navy: #06133d;
    --rd-navy-soft: #10275c;
    --rd-blue: #1558b5;
    --rd-blue-hover: #104897;
    --rd-text: #172b4d;
    --rd-muted: #657a9d;
    --rd-line: #dbe7f5;
    --rd-page: #edf5ff;
}

html, body { min-height: 100%; }
body.rd-app {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    color: var(--rd-text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background: linear-gradient(135deg, #e7f1ff 0%, #f7fbff 42%, #f1f7ff 100%);
}

.rd-header { position: relative; z-index: 10; background: var(--rd-navy); box-shadow: 0 5px 18px rgba(5, 24, 64, .18); }
.rd-header .navbar { min-height: 76px; padding: .65rem 0; }
.rd-brand { display: inline-flex; align-items: center; gap: .7rem; margin-right: 1rem; color: #fff; font-size: 1.14rem; font-weight: 700; white-space: nowrap; }
.rd-brand:hover { color: #fff; }
.rd-brand img { width: 42px; height: 42px; object-fit: contain; }
.rd-brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.rd-brand-text small { margin-top: .2rem; color: rgba(255,255,255,.72); font-size: .68rem; font-weight: 600; letter-spacing: .045em; text-transform: uppercase; }
.rd-header .navbar-toggler { border-color: rgba(255,255,255,.45); }
.rd-header .navbar-toggler-icon { filter: invert(1); }
.rd-header .nav-link { padding: .78rem .95rem !important; color: rgba(255,255,255,.86) !important; border-left: 1px solid rgba(255,255,255,.11); font-size: .94rem; font-weight: 500; }
.rd-header .nav-link:hover, .rd-header .nav-link.active { color: #fff !important; background: rgba(18, 66, 144, .45); }
.rd-header .dropdown-menu { min-width: 220px; padding: .35rem; background: #071947; border: 1px solid rgba(255,255,255,.14); border-radius: .7rem; box-shadow: 0 16px 28px rgba(0, 19, 65, .3); }
.rd-header .dropdown-item { padding: .58rem .72rem; color: #eef5ff; border-radius: .45rem; font-size: .92rem; }
.rd-header .dropdown-item:hover { color: #fff; background: rgba(50, 104, 196, .42); }
.rd-user { display: flex; align-items: center; gap: .65rem; margin-left: 1rem; color: #fff; font-size: .9rem; font-weight: 700; white-space: nowrap; }
.rd-client { max-width: 220px; overflow: hidden; padding: .48rem .8rem; color: #dbe9ff; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: rgba(255,255,255,.06); text-overflow: ellipsis; }
.rd-user-name { padding: .48rem .8rem; border: 1px solid rgba(255,255,255,.32); border-radius: 999px; background: rgba(255,255,255,.09); }
.rd-logout { padding: .48rem .85rem; color: #fff; border: 1px solid rgba(255,255,255,.32); border-radius: 999px; background: transparent; text-decoration: none; }
.rd-logout:hover { color: #fff; background: rgba(255,255,255,.12); }
.rd-context { background: rgba(255,255,255,.94); border-bottom: 1px solid var(--rd-line); box-shadow: 0 5px 16px rgba(36, 77, 140, .08); }
.rd-context .container { display: flex; align-items: center; min-height: 54px; color: var(--rd-muted); font-size: .91rem; }
.rd-context i { margin-right: .5rem; color: #47678f; }
.rd-context-home { display: inline-flex; align-items: center; color: #365b87; font-weight: 600; text-decoration: none; }
.rd-context-home:hover { color: var(--rd-primary); text-decoration: underline; }

.rd-main { flex: 1 0 auto; width: 100%; }
.rd-main.container { max-width: 1440px; }
.rd-main .card { border: 1px solid var(--rd-line); border-radius: 1rem; box-shadow: 0 12px 30px rgba(38, 78, 137, .08); }
.rd-main .card-body { padding: 1.75rem; }
.rd-main h1, .rd-main h2, .rd-main h3 { color: var(--rd-text); font-weight: 700; letter-spacing: -.02em; }
.rd-main h1 { font-size: clamp(1.55rem, 2vw, 2rem); }
.rd-main .form-label, .rd-main .col-form-label { color: #233c63; font-weight: 650; }
.rd-main .form-control, .rd-main .form-select { min-height: 42px; border-color: #ccddf1; color: var(--rd-text); }
.rd-main .form-control:focus, .rd-main .form-select:focus { border-color: #71a5eb; box-shadow: 0 0 0 .2rem rgba(21, 88, 181, .13); }
.rd-main .btn { border-radius: .55rem; font-weight: 650; }
.rd-main .btn-primary { border-color: var(--rd-blue); background: linear-gradient(110deg, #092c73, #1762c8); }
.rd-main .btn-primary:hover { border-color: var(--rd-blue-hover); background: linear-gradient(110deg, #08245c, #104d9e); }
.rd-main .table { --bs-table-color: var(--rd-text); --bs-table-bg: transparent; margin-bottom: 0; }
.rd-main .table thead th { padding: .9rem .75rem; color: #29466e; background: #f3f7fd; border-bottom-color: var(--rd-line); font-size: .88rem; white-space: nowrap; }
.rd-main .table td { padding: .82rem .75rem; border-color: #e4edf8; }
.rd-main .nav-tabs { border-bottom-color: var(--rd-line); }
.rd-main .nav-tabs .nav-link { color: #536d92; font-weight: 650; }
.rd-main .nav-tabs .nav-link.active { color: var(--rd-navy); border-color: var(--rd-line) var(--rd-line) #fff; }
.rd-footer { flex-shrink: 0; padding: 1rem 0; color: rgba(255,255,255,.78); background: var(--rd-navy); font-size: .82rem; }
.rd-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.rd-footer-brand { display: flex; align-items: center; gap: .55rem; color: #fff; font-size: .95rem; font-weight: 700; }
.rd-footer-brand img { width: 32px; height: 32px; object-fit: contain; }

body.rd-login { min-height: 100vh; color: var(--rd-text); font-family: Inter, "Segoe UI", Arial, sans-serif; background: linear-gradient(135deg, rgba(5, 17, 47, .96), rgba(20, 47, 80, .9)), url('../head/background.jpg') center / cover fixed; }
.rd-login-page { display: grid; min-height: 100vh; place-items: center; padding: 1.5rem; }
.rd-login-card { width: min(100%, 540px); padding: 3rem; background: rgba(255,255,255,.98); border: 1px solid rgba(255,255,255,.7); border-radius: 1.1rem; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.rd-login-brand { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.rd-login-brand img { width: 64px; height: 64px; object-fit: contain; }
.rd-login-brand strong { display: block; font-size: 1.28rem; }
.rd-login-brand span { color: var(--rd-muted); font-size: .83rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.rd-login-card h1 { margin-bottom: .4rem; font-size: 2rem; font-weight: 700; }
.rd-login-intro { margin-bottom: 2rem; color: var(--rd-muted); font-size: 1.03rem; }
.rd-login-card .form-label { color: #1e2f4c; font-weight: 700; }
.rd-login-card .form-control { min-height: 54px; border-color: #ceddf0; border-radius: .7rem; font-size: 1.05rem; }
.rd-login-card .form-control:focus { border-color: #6ca0e6; box-shadow: 0 0 0 .2rem rgba(21, 88, 181, .13); }
.rd-login-card .btn-primary { min-height: 54px; border: 0; border-radius: .7rem; background: linear-gradient(110deg, #071c50, #1762c8); font-size: 1.05rem; font-weight: 700; box-shadow: 0 10px 20px rgba(21, 88, 181, .2); }
@media (max-width: 991.98px) { .rd-header .nav-link { border-left: 0; } .rd-user { margin: .8rem 0 0; } }
@media (max-width: 575.98px) { .rd-login-card { padding: 2rem 1.5rem; } .rd-login-card h1 { font-size: 1.65rem; } .rd-footer .container { flex-direction: column; text-align: center; } }
