/* ============================================================
   License Panel - stylesheet
   Palette: ink #12131A, slate #1E2029, mist #F5F6F8, indigo #4F5EFF,
            success #1FAA6B, danger #E5484D, warn #D98C1B
   ============================================================ */

* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    background: #F5F6F8;
    color: #171923;
    font-family: 'Segoe UI', Inter, system-ui, -apple-system, sans-serif;
    font-size: 14px;
}
a { color: inherit; text-decoration: none; }

/* ---------- auth (login) pages ---------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 50%, rgba(31, 101, 255, 0.18), transparent 34%),
        radial-gradient(circle at 10% 92%, rgba(20, 122, 255, 0.55), transparent 26%),
        radial-gradient(circle at 90% 92%, rgba(20, 122, 255, 0.5), transparent 22%),
        linear-gradient(rgba(0, 6, 26, 0.88), rgba(0, 6, 26, 0.94)),
        repeating-linear-gradient(
            90deg,
            rgba(77, 143, 255, 0.10) 0,
            rgba(77, 143, 255, 0.10) 2px,
            transparent 2px,
            transparent 72px
        ),
        linear-gradient(180deg, #010918 0%, #03122d 100%);
    padding: 26px 16px;
    overflow: hidden;
}
.auth-card {
    width: 100%;
    max-width: 460px;
}
.auth-card-premium {
    position: relative;
    padding: 12px 0 8px;
    color: #dfe9ff;
}
.auth-corner-chip {
    position: absolute;
    top: 0;
    left: 14px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(75, 183, 255, 0.45);
    box-shadow: 0 0 14px rgba(53, 176, 255, 0.25), inset 0 0 12px rgba(53, 176, 255, 0.10);
    color: #eef7ff;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: .08em;
    text-align: center;
    background: rgba(4, 17, 49, 0.62);
}
.auth-float {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.8;
}
.auth-float-left {
    top: 180px;
    left: -12px;
    background: radial-gradient(circle, rgba(17, 168, 255, 0.18), transparent 68%);
}
.auth-float-right {
    top: 78px;
    right: 8px;
    background: radial-gradient(circle, rgba(54, 136, 255, 0.24), transparent 66%);
}
.auth-brand {
    text-align: center;
    padding: 42px 18px 12px;
}
.auth-logo-mark {
    width: 68px;
    height: 68px;
    margin: 0 auto 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 22px;
    color: #08152d;
    background:
        radial-gradient(circle at 30% 30%, #67e7ff 0%, #2dd0ff 25%, #2f73ff 60%, #0a122a 100%);
    box-shadow: 0 0 18px rgba(46, 183, 255, 0.55), 0 0 42px rgba(46, 183, 255, 0.30);
}
.auth-brand h1 {
    margin: 0;
    color: #ffffff;
    font-size: 40px;
    line-height: 0.98;
    letter-spacing: .03em;
    font-weight: 900;
    text-shadow: 0 0 22px rgba(75, 173, 255, 0.35);
}
.auth-brand-sub {
    margin-top: 8px;
    font-size: 12px;
    letter-spacing: .28em;
    color: #9ccaff;
    font-weight: 700;
}
.auth-brand-line {
    margin-top: 10px;
    font-size: 11px;
    letter-spacing: .18em;
    color: #dcecff;
    position: relative;
    display: inline-block;
    padding: 0 18px;
}
.auth-brand-line::before,
.auth-brand-line::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 36px;
    height: 1px;
    background: rgba(166, 204, 255, 0.6);
}
.auth-brand-line::before { left: -28px; }
.auth-brand-line::after { right: -28px; }
.auth-ribbon {
    width: 228px;
    max-width: calc(100% - 42px);
    margin: 6px auto -8px;
    text-align: center;
    padding: 8px 12px;
    border-radius: 16px 16px 8px 8px;
    background: linear-gradient(180deg, rgba(25, 72, 154, 0.9), rgba(14, 43, 105, 0.92));
    border: 1px solid rgba(94, 163, 255, 0.38);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.12);
    color: #ecf6ff;
    font-weight: 800;
    letter-spacing: .14em;
}
.auth-panel {
    position: relative;
    margin: 0 auto;
    width: 100%;
    max-width: 390px;
    padding: 22px 20px 18px;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(6, 18, 49, 0.92), rgba(4, 13, 38, 0.96));
    border: 1px solid rgba(89, 192, 255, 0.48);
    box-shadow:
        0 0 18px rgba(53, 176, 255, 0.32),
        0 0 55px rgba(12, 89, 255, 0.22),
        inset 0 0 24px rgba(33, 132, 255, 0.12);
}
.field { margin-bottom: 16px; }
.btn {
    display: inline-block;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}
.btn-primary { background: #4F5EFF; color: #fff; width: 100%; }
.btn-primary:hover { background: #3F4CE0; }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 6px; }
.btn-success { background: #1FAA6B; color: #fff; }
.btn-danger { background: #E5484D; color: #fff; }
.btn-warn { background: #D98C1B; color: #fff; }
.btn-ghost { background: #EEF0F4; color: #33384A; }
.error-box {
    background: rgba(132, 18, 36, 0.26);
    border: 1px solid rgba(255, 110, 138, 0.28);
    color: #ffd8e0;
    padding: 11px 13px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 16px;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-input-wrap {
    display: grid;
    grid-template-columns: 52px 1fr 34px;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(105, 151, 227, 0.22);
    background: rgba(11, 24, 58, 0.88);
    box-shadow: inset 0 0 18px rgba(123, 181, 255, 0.04);
}
.auth-input-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #66d8ff;
    border: 1px solid rgba(90, 187, 255, 0.35);
    box-shadow: inset 0 0 12px rgba(64, 173, 255, 0.12), 0 0 10px rgba(64, 173, 255, 0.12);
    position: relative;
}
.auth-input-icon::before,
.auth-input-icon::after {
    content: "";
    position: absolute;
}
.auth-input-user::before {
    top: 8px;
    left: 11px;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 50%;
}
.auth-input-user::after {
    left: 8px;
    bottom: 8px;
    width: 20px;
    height: 10px;
    border: 2px solid currentColor;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom: 0;
}
.auth-input-lock::before {
    top: 7px;
    left: 11px;
    width: 14px;
    height: 10px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}
.auth-input-lock::after {
    left: 9px;
    bottom: 8px;
    width: 18px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 4px;
}
.auth-input-body label {
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    color: #9cb5dd;
    font-weight: 700;
    letter-spacing: .14em;
}
.auth-input-body input {
    width: 100%;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 16px;
    padding: 0;
}
.auth-input-body input::placeholder {
    color: #91a4c8;
}
.auth-input-body input:focus {
    outline: none;
}
.auth-input-trail {
    text-align: center;
    color: #83a6df;
    font-size: 18px;
    line-height: 1;
    position: relative;
    border: 0;
    background: transparent;
    padding: 0;
}
.auth-input-trail-user::before {
    content: "";
    position: absolute;
    top: 6px;
    right: 3px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(156, 181, 221, 0.75);
}
.auth-input-trail-user::after {
    content: "";
    position: absolute;
    right: 1px;
    bottom: 5px;
    width: 15px;
    height: 7px;
    border-radius: 8px 8px 0 0;
    background: rgba(156, 181, 221, 0.45);
}
.auth-eye {
    width: 24px;
    height: 24px;
    justify-self: center;
    color: #9cb5dd;
}
.auth-eye::before,
.auth-eye::after {
    content: "";
    position: absolute;
}
.auth-eye::before {
    top: 7px;
    left: 2px;
    width: 18px;
    height: 10px;
    border: 2px solid currentColor;
    border-radius: 12px / 8px;
}
.auth-eye::after {
    top: 3px;
    left: 10px;
    width: 2px;
    height: 18px;
    background: currentColor;
    transform: rotate(45deg);
}
.auth-submit-btn {
    margin-top: 4px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 15px;
    letter-spacing: .08em;
    background: linear-gradient(90deg, #0d66ff 0%, #15d5ff 100%);
    box-shadow: 0 10px 25px rgba(19, 132, 255, 0.35);
}
.auth-submit-btn span {
    float: right;
}
.auth-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 0 2px;
}
.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #d7e8ff;
    font-size: 14px;
}
.auth-check input {
    accent-color: #1598ff;
}
.auth-help-link {
    color: #4ac0ff;
    font-size: 12px;
    font-weight: 700;
}
.auth-help-link:hover {
    color: #8dd8ff;
}
.auth-divider {
    margin: 16px 0 14px;
    text-align: center;
    color: #a8c6ef;
    font-size: 10px;
    letter-spacing: .22em;
    position: relative;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 78px;
    height: 1px;
    background: rgba(124, 173, 236, 0.35);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-security-note {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #dcecff;
}
.auth-security-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6de0ff;
    border: 1px solid rgba(84, 190, 255, 0.30);
    box-shadow: inset 0 0 18px rgba(68, 173, 255, 0.16), 0 0 18px rgba(68, 173, 255, 0.10);
    position: relative;
}
.auth-security-icon::before,
.auth-security-icon::after {
    content: "";
    position: absolute;
}
.auth-security-icon::before {
    top: 10px;
    left: 15px;
    width: 16px;
    height: 20px;
    border: 2px solid currentColor;
    border-top: 0;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
}
.auth-security-icon::after {
    top: 15px;
    left: 20px;
    width: 6px;
    height: 10px;
    border: 2px solid currentColor;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    border-bottom: 0;
}
.auth-security-note strong {
    font-size: 15px;
    color: #ffffff;
}
.auth-security-note span {
    font-size: 12px;
    color: #9bb6dc;
}
.auth-feature-strip {
    margin: 14px auto 10px;
    max-width: 400px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 10px 12px;
    border-radius: 18px;
    border: 1px solid rgba(89, 192, 255, 0.26);
    background: rgba(5, 17, 45, 0.62);
    box-shadow: inset 0 0 16px rgba(42, 134, 255, 0.08);
}
.auth-feature {
    text-align: center;
    color: #86daff;
    font-size: 12px;
    font-weight: 800;
}
.auth-feature small {
    display: block;
    margin-top: 3px;
    font-size: 9px;
    color: #d5e8ff;
    letter-spacing: .08em;
}
.auth-footer-note {
    text-align: center;
    color: #8eadcf;
    font-size: 11px;
    line-height: 1.5;
}

@media (max-height: 760px) {
  .auth-wrap {
    align-items: flex-start;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .auth-card-premium {
    transform: scale(0.74);
    transform-origin: top center;
  }
  .auth-feature-strip,
  .auth-footer-note {
    display: none;
  }
  .auth-brand {
    padding-top: 30px;
    padding-bottom: 8px;
  }
  .auth-corner-chip {
    top: 6px;
  }
}

@media (max-height: 640px) {
  .auth-card-premium {
    transform: scale(0.64);
  }
  .auth-brand-sub,
  .auth-brand-line,
  .auth-divider,
  .auth-security-note {
    display: none;
  }
  .auth-brand {
    padding-top: 24px;
    padding-bottom: 4px;
  }
  .auth-ribbon {
    margin-bottom: -4px;
  }
}

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; position: relative; }
.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: #12131A;
    color: #D6D8E0;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    transition: width 0.25s ease, padding 0.25s ease, transform 0.25s ease;
    overflow: hidden;
    position: relative;
    z-index: 1100;
}
.sidebar-backdrop {
    display: none;
}
.sidebar-top { display: flex; flex-direction: column; gap: 0; }
.brand { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; padding: 0 4px; }
.brand-mark { color: #4F5EFF; font-size: 18px; }
.brand-text { font-weight: 700; font-size: 14px; color: #fff; letter-spacing: .01em; }
.user-chip { background: #1E2029; border-radius: 10px; padding: 10px 12px; margin-bottom: 18px; }
.user-chip-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-chip-role { font-size: 11px; color: #8489A0; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link { padding: 9px 12px; border-radius: 8px; font-size: 13px; color: #C7C9D6; }
.nav-link:hover { background: #1E2029; color: #fff; }
.logout-link { padding: 12px; font-size: 13px; color: #8489A0; border-top: 1px solid #23242E; margin-top: 8px; }
.logout-link:hover { color: #E5484D; }

.content { flex: 1; width: calc(100vw - 230px); max-width: none; padding: 30px 36px; transition: width 0.25s ease, padding-left 0.25s ease; }
.content-header { margin-bottom: 20px; display: flex; align-items: center; gap: 12px; }
.content-header h1 { font-size: 21px; margin: 0; color: #12131A; }
.menu-toggle {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f68ff 0%, #18c8ff 100%);
    color: #ffffff;
    border: 1px solid rgba(47, 140, 255, 0.55);
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    box-shadow: 0 12px 28px rgba(20, 121, 255, 0.28), inset 0 1px 0 rgba(255,255,255,0.18);
    position: relative;
    z-index: 1200;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.menu-toggle:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 14px 30px rgba(20, 121, 255, 0.34), inset 0 1px 0 rgba(255,255,255,0.2);
}
.menu-toggle:active {
    transform: scale(0.97);
}
.menu-toggle:focus-visible {
    outline: 3px solid rgba(24, 200, 255, 0.25);
    outline-offset: 3px;
}

.shell.sidebar-collapsed .sidebar {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    border: 0;
    transform: translateX(-100%);
}
.shell.sidebar-collapsed .content {
    width: 100vw;
    padding-left: 24px;
}

.flash { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 18px; }
.flash-success { background: #E7F8EF; color: #17784F; }
.flash-error { background: #FDECEC; color: #B3232A; }

/* ---------- cards / stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-card { background: #fff; border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(20,20,30,0.06); border: 1px solid #ECEDF2; }
.stat-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #8489A0; font-weight: 600; }
.stat-card .value { font-size: 24px; font-weight: 700; margin-top: 6px; color: #12131A; }

.panel { background: #fff; border-radius: 12px; border: 1px solid #ECEDF2; padding: 20px 22px; margin-bottom: 22px; box-shadow: 0 1px 2px rgba(20,20,30,0.05); }
.panel h2 { font-size: 15px; margin: 0 0 16px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: #8489A0; padding: 8px 10px; border-bottom: 1px solid #ECEDF2; }
td { padding: 10px; border-bottom: 1px solid #F1F2F5; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
code.key { font-family: 'Consolas', Menlo, monospace; background: #F1F2F7; padding: 3px 7px; border-radius: 5px; font-size: 12.5px; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-active { background: #E7F8EF; color: #17784F; }
.badge-inactive { background: #FDECEC; color: #B3232A; }
.badge-paid { background: #E7F8EF; color: #17784F; }
.badge-unpaid { background: #FFF4E5; color: #B86B00; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions form { display: inline; }

.inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; min-width: 160px; }

@media (max-width: 800px) {
  .auth-card {
    max-width: 100%;
  }
  .auth-brand {
    padding-top: 50px;
  }
  .auth-brand h1 {
    font-size: 32px;
  }
  .auth-brand-sub {
    font-size: 12px;
    letter-spacing: .24em;
  }
  .auth-panel {
    padding: 20px 16px 18px;
    border-radius: 22px;
  }
  .auth-input-wrap {
    grid-template-columns: 44px 1fr 26px;
    gap: 10px;
    padding: 10px 12px;
  }
  .auth-input-icon {
    width: 34px;
    height: 34px;
  }
  .auth-input-body input {
    font-size: 16px;
  }
  .auth-meta-row {
    flex-wrap: wrap;
  }
  .auth-divider::before,
  .auth-divider::after {
    width: 42px;
  }
  .auth-feature-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .shell { flex-direction: row; }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(7, 12, 24, 0.48);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 230px;
    padding: 18px 14px 14px;
    overflow-y: auto;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.32);
  }
  .sidebar-top { width: 100%; }
  .brand { margin-bottom: 12px; }
  .user-chip { margin-bottom: 12px; }
  .nav { flex-direction: column; flex-wrap: nowrap; }
  .logout-link { width: auto; }
  .content { width: 100%; padding: 76px 20px 20px; }
  .content-header {
    margin-bottom: 18px;
  }
  .menu-toggle {
    position: fixed;
    top: 18px;
    left: 16px;
    width: 52px;
    height: 52px;
  }
  .shell.sidebar-collapsed .sidebar {
    width: 230px;
    padding-left: 14px;
    padding-right: 14px;
    transform: translateX(-100%);
  }
  .shell.sidebar-collapsed .content { width: 100%; }
  .shell.sidebar-collapsed .sidebar-backdrop {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  body:not(.sidebar-open-mobile) {
    overflow-x: hidden;
  }
}
