/* PhotoLink PRO — Server Lisensi */

:root {
    --ink: #121a27;
    --text: #3d4758;
    --muted: #6a7486;
    --line: #dfe4ec;
    --surface: #ffffff;
    --canvas: #f3f5f9;
    --navy: #131b29;
    --navy-soft: #1f2a3c;
    --accent: #0b74d1;
    --accent-strong: #095ba6;
    --accent-soft: #e7f2fc;
    --green: #18794e;
    --green-soft: #e3f4ea;
    --amber: #8a5a06;
    --amber-soft: #fcf3dc;
    --red: #b3261e;
    --red-soft: #fce9e7;
    --gold: #f0b849;
    --radius: 10px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--text);
    font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a {
    color: var(--accent);
}

a:hover {
    color: var(--accent-strong);
}

h1,
h2 {
    margin: 0;
    color: var(--ink);
    font-weight: 650;
    letter-spacing: -0.01em;
}

h1 {
    font-size: 26px;
    line-height: 1.2;
}

h2 {
    margin-bottom: 14px;
    font-size: 17px;
}

h2 .muted {
    margin-left: 6px;
    font-size: 13px;
    font-weight: 400;
}

code {
    padding: 2px 6px;
    border-radius: 4px;
    background: #eceff4;
    color: var(--ink);
    font: 13px/1.4 Consolas, Monaco, "SFMono-Regular", monospace;
}

code.block {
    display: block;
    padding: 10px 12px;
    overflow-wrap: anywhere;
    user-select: all;
}

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

.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Kepala ---------- */

.top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 28px;
    padding: 12px max(20px, calc((100vw - 1240px) / 2));
    background: var(--navy);
    color: #dfe5ee;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.15;
    text-decoration: none;
}

.brand:hover {
    color: #fff;
}

.brand b {
    margin-left: 2px;
    padding: 2px 7px;
    border-radius: 4px;
    background: linear-gradient(135deg, #1e90ff, #18a06b);
    font-size: 11px;
    letter-spacing: 0.08em;
    vertical-align: middle;
}

.brand small {
    display: block;
    color: #9aa6b8;
    font-size: 12px;
    font-weight: 400;
}

.menu {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: 4px;
}

.menu a {
    padding: 8px 14px;
    border-radius: 6px;
    color: #b9c3d2;
    font-weight: 500;
    text-decoration: none;
}

.menu a:hover {
    background: var(--navy-soft);
    color: #fff;
}

.menu a.is-active {
    background: var(--navy-soft);
    color: #fff;
    box-shadow: inset 0 -2px 0 var(--gold);
}

.logout {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: #9aa6b8;
    font-size: 14px;
}

/* ---------- Halaman ---------- */

.page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 20px 40px;
}

.head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.back {
    display: inline-block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
}

.back::before {
    content: "\2039\00a0";
}

.foot {
    padding: 0 20px 28px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.panel {
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.panel--flush {
    padding: 0;
}

.empty {
    margin: 0;
    padding: 40px 24px;
    text-align: center;
}

.cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    align-items: start;
}

.cols--form {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}

.stack {
    display: grid;
    gap: 16px;
}

/* ---------- Tombol ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid #c5cdd9;
    border-radius: 7px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 550;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    border-color: #98a3b5;
    color: var(--ink);
}

.btn--primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.btn--primary:hover {
    border-color: var(--accent-strong);
    background: var(--accent-strong);
    color: #fff;
}

.btn--danger {
    border-color: #e5b3ae;
    color: var(--red);
}

.btn--danger:hover {
    border-color: var(--red);
    background: var(--red);
    color: #fff;
}

.btn--ghost {
    border-color: #3a475c;
    background: transparent;
    color: #dfe5ee;
}

.btn--ghost:hover {
    border-color: #6b7a92;
    color: #fff;
}

.btn--block {
    width: 100%;
    min-height: 44px;
}

.link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.link--danger {
    color: var(--red);
}

/* ---------- Pemberitahuan ---------- */

.alert {
    margin-bottom: 18px;
    padding: 12px 16px;
    border: 1px solid #b8dcc7;
    border-radius: 8px;
    background: var(--green-soft);
    color: var(--ink);
    overflow-wrap: anywhere;
}

.alert--error {
    border-color: #f0bcb7;
    background: var(--red-soft);
}

.alert--warning {
    border-color: #ecd9ae;
    background: var(--amber-soft);
}

/* ---------- Angka ringkas ---------- */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
}

a.stat:hover {
    border-color: #b9c3d2;
    color: inherit;
}

.stat__value {
    color: var(--ink);
    font-size: 34px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.stat__label {
    color: var(--ink);
    font-weight: 600;
}

.stat__note {
    color: var(--muted);
    font-size: 13px;
}

.stat--accent {
    border-color: var(--navy);
    background: var(--navy);
}

.stat--accent .stat__value {
    color: var(--gold);
}

.stat--accent .stat__label {
    color: #fff;
}

.stat--accent .stat__note {
    color: #aab4c3;
}

/* ---------- Daftar ---------- */

.list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    padding: 10px 0;
}

.list li + li {
    border-top: 1px solid var(--line);
}

.list form {
    margin: 0;
}

.list__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-wrap: anywhere;
}

.list__main a,
.list__main strong {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.list__main a:hover {
    color: var(--accent);
}

.list__main .muted {
    font-size: 13px;
}

.meter {
    flex: 1 1 100%;
    height: 6px;
    border-radius: 999px;
    background: #e6eaf0;
    overflow: hidden;
}

.meter span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #1e90ff, #18a06b);
}

/* ---------- Bilah alat dan tabel ---------- */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filters a {
    padding: 6px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.filters a.is-active {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.search {
    display: flex;
    flex: 1 1 280px;
    gap: 8px;
    max-width: 420px;
    margin: 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 13px 20px;
    text-align: left;
    vertical-align: top;
}

.table th {
    border-bottom: 1px solid var(--line);
    background: #f8f9fb;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.table tbody tr + tr td {
    border-top: 1px solid var(--line);
}

.table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.table--compact th,
.table--compact td {
    padding: 8px 10px;
}

.table__title {
    display: block;
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.table__sub {
    display: block;
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.table__actions {
    text-align: right;
    white-space: nowrap;
}

.pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}

.pill--lg {
    padding: 5px 14px;
    font-size: 14px;
}

.pill--active {
    background: var(--green-soft);
    color: var(--green);
}

.pill--expired {
    background: var(--amber-soft);
    color: var(--amber);
}

.pill--suspended {
    background: var(--red-soft);
    color: var(--red);
}

.pill--unlicensed {
    background: #eceff4;
    color: #5a6475;
}

/* ---------- Kunci lisensi ---------- */

.keybox {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding: 18px 24px;
    border-radius: var(--radius);
    background: var(--navy);
}

.keybox__label {
    display: block;
    color: #9aa6b8;
    font-size: 13px;
}

.keybox__key {
    padding: 0;
    background: none;
    color: var(--gold);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
    user-select: all;
}

/* ---------- Formulir ---------- */

.form h2 + .muted {
    margin: -6px 0 16px;
}

.form h2:not(:first-of-type) {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.form--narrow {
    max-width: 520px;
}

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

.field {
    margin-bottom: 16px;
}

.field--short {
    max-width: 260px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid #b9c2d0;
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    outline: 2px solid var(--accent);
    outline-offset: 0;
}

input:disabled {
    background: #f1f3f7;
    color: var(--muted);
}

.help {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    font-weight: 500;
}

.check input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--accent);
}

.form__foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.actions form {
    margin: 0;
}

/* ---------- Halaman masuk ---------- */

body.is-bare {
    min-height: 100vh;
    background: radial-gradient(1100px 600px at 20% -10%, #1f3b63 0%, transparent 60%), radial-gradient(900px 500px at 100% 110%, #14523a 0%, transparent 55%), var(--navy);
}

.login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login__card {
    width: 100%;
    max-width: 380px;
    padding: 34px 30px 30px;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(4, 10, 20, 0.45);
    text-align: center;
}

.login__card h1 {
    margin-top: 10px;
    font-size: 24px;
}

.login__card h1 b {
    padding: 2px 8px;
    border-radius: 4px;
    background: linear-gradient(135deg, #1e90ff, #18a06b);
    color: #fff;
    font-size: 12px;
    letter-spacing: 0.08em;
    vertical-align: middle;
}

.login__card .muted {
    margin: 2px 0 22px;
}

.login__card label {
    text-align: left;
}

.login__card input {
    margin-bottom: 14px;
}

.login__card .alert {
    text-align: left;
}

/* ---------- Layar kecil ---------- */

@media (max-width: 900px) {
    .cols--form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .top {
        padding: 12px 16px;
    }

    .menu {
        order: 3;
        flex: 1 1 100%;
    }

    .menu a {
        flex: 1 1 auto;
        text-align: center;
    }

    .logout {
        margin-left: auto;
    }

    .logout span {
        display: none;
    }

    .page {
        padding: 20px 14px 32px;
    }

    .panel {
        padding: 18px 16px;
    }

    .panel--flush {
        padding: 0;
    }

    .keybox__key {
        font-size: 17px;
    }

    /* Tabel menjadi kartu bertumpuk */
    .table,
    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table thead {
        display: none;
    }

    .table tr {
        padding: 12px 16px;
    }

    .table tr + tr {
        border-top: 1px solid var(--line);
    }

    .table td,
    .table tbody tr + tr td {
        padding: 3px 0;
        border: 0;
        text-align: left;
    }

    .table td[data-label]:not([data-label="Pelanggan"])::before {
        content: attr(data-label) ": ";
        color: var(--muted);
        font-size: 13px;
    }

    .table__actions {
        padding-top: 8px;
        text-align: left;
    }
}


/* ---------- Mesin PhotoLink di server ---------- */

.engine-panel {
    margin-bottom: 16px;
}

.engine-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    border: 1px solid var(--line);
    border-radius: 8px;
}

.engine-stats div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
}

.engine-stats div + div {
    border-left: 1px solid var(--line);
}

.engine-stats strong {
    color: var(--ink);
    font-size: 26px;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.engine-stats span {
    color: var(--muted);
    font-size: 13px;
}

.engine-warn {
    margin: 14px 0 0;
}

@media (max-width: 760px) {
    .engine-stats div + div {
        border-left: 0;
        border-top: 1px solid var(--line);
    }
}
