/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
}

body.index-body {
    background: #ffffff;
    color: #333;
}

body.index-body .card {
    background: #fff;
    border: 1px solid #e0e0e0;
}

body.index-body .logo h1 {
    color: #111;
}

body.index-body .subtitle {
    color: #999;
}

body.index-body input[type="text"] {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
}

body.index-body input[type="text"]:focus {
    border-color: #999;
}

body.index-body input::placeholder {
    color: #aaa;
}

body.index-body button, body.index-body .btn-primary {
    background: #111;
    color: #fff;
}

body.index-body .message.error { color: #999; }
body.index-body .message.success { color: #111; }

body.index-body .result {
    background: #fafafa;
    border: 1px solid #e0e0e0;
}

body.index-body .result-header {
    background: #111;
    color: #fff;
}

body.index-body .result-row {
    border-bottom-color: #eee;
}

body.index-body .result-row label {
    color: #999;
}

body.index-body .result-row .value {
    color: #333;
}

body.index-body .copy-btn, body.index-body .toggle-btn {
    background: #eee;
    color: #555;
}

body.index-body .copy-btn:hover, body.index-body .toggle-btn:hover {
    background: #ddd;
}

body.index-body .password-masked {
    color: #ccc !important;
}

body.index-body .expiry { color: #666 !important; }
body.index-body .remaining { color: #111 !important; }

body.index-body .toast {
    background: #111;
    color: #fff;
}

/* ===== Info Box ===== */
.info-box {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.info-text {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

/* ===== Admin White Theme ===== */
body.admin-body {
    background: #f0f0f0;
    color: #333;
}

body.admin-body .card {
    background: #fff;
    border: 1px solid #e0e0e0;
}

body.admin-body .logo h1 {
    color: #111;
}

body.admin-body .subtitle {
    color: #999;
}

body.admin-body input[type="text"],
body.admin-body input[type="password"],
body.admin-body input[type="number"],
body.admin-body select,
body.admin-body textarea {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
}

body.admin-body input:focus,
body.admin-body select:focus,
body.admin-body textarea:focus {
    border-color: #999;
}

body.admin-body input::placeholder {
    color: #aaa;
}

body.admin-body button,
body.admin-body .btn-primary {
    background: #111;
    color: #fff;
}

body.admin-body .btn-small {
    background: #eee;
    color: #555;
}

body.admin-body .btn-danger {
    background: #ddd !important;
    color: #888 !important;
    border: 1px solid #ccc !important;
}

body.admin-body .message.error { color: #999; }
body.admin-body .message.success { color: #111; }

body.admin-body .navbar {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

body.admin-body .nav-title {
    color: #111;
}

body.admin-body .tabs {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

body.admin-body .tab {
    color: #999 !important;
    background: transparent !important;
}

body.admin-body .tab.active {
    color: #111 !important;
    border-bottom-color: #111 !important;
}

body.admin-body .section-header h2 {
    color: #111;
}

body.admin-body .table-wrap {
    background: #fff;
    border: 1px solid #e0e0e0;
}

body.admin-body thead {
    background: #fafafa;
}

body.admin-body th {
    color: #999;
    border-bottom-color: #e0e0e0;
}

body.admin-body td {
    border-bottom-color: #f0f0f0;
    color: #333;
}

body.admin-body tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

body.admin-body .empty {
    color: #bbb;
}

body.admin-body .mono {
    color: #111;
}

body.admin-body .badge-ok {
    background: rgba(0, 0, 0, 0.08);
    color: #333;
}

body.admin-body .badge-expired {
    background: rgba(0, 0, 0, 0.04);
    color: #bbb;
}

body.admin-body .modal-backdrop {
    background: rgba(0, 0, 0, 0.5);
}

body.admin-body .modal-content {
    background: #fff;
    border: 1px solid #e0e0e0;
}

body.admin-body .modal-header h3 {
    color: #111;
}

body.admin-body .modal-close {
    background: #eee;
    color: #888;
}

body.admin-body .modal-close:hover {
    background: #ddd;
}

body.admin-body .form-group label {
    color: #999;
}

body.admin-body .toast {
    background: #111;
    color: #fff;
}

body.admin-body textarea {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
}

/* ===== Container ===== */
.container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* ===== Card ===== */
.card {
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 480px;
}

.main-card {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* ===== Logo ===== */
.logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.subtitle {
    color: #777;
    font-size: 14px;
    margin-top: 8px;
}

/* ===== Input Group ===== */
.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.input-group.vertical {
    flex-direction: column;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 12px 16px;
    color: #e0e0e0;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    border-color: #555;
}

input::placeholder {
    color: #555;
}

/* ===== Buttons ===== */
button, .btn-primary {
    background: #fff;
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    white-space: nowrap;
}

button:hover { opacity: 0.85; }
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-small {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
    background: #222;
    color: #ccc;
}

.btn-danger {
    background: #333 !important;
    color: #e0e0e0 !important;
    border: 1px solid #444 !important;
}

.btn-danger:hover {
    background: #444 !important;
}

/* ===== Messages ===== */
.message {
    text-align: center;
    font-size: 14px;
    margin-top: 12px;
    min-height: 20px;
}

.message.error { color: #999; }
.message.success { color: #fff; }

/* ===== Result Card ===== */
.result {
    margin-top: 24px;
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
}

.result-header {
    background: #fff;
    color: #000;
    padding: 12px 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-body {
    padding: 16px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #1e1e1e;
}

.result-row:last-child { border-bottom: none; }

.result-row label {
    color: #777;
    font-size: 14px;
    flex-shrink: 0;
    width: 80px;
}

.result-row .value {
    color: #e0e0e0;
    font-size: 14px;
    word-break: break-all;
    text-align: right;
}

.copy-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-btn, .toggle-btn {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
    background: #222;
    color: #ccc;
    cursor: pointer;
    flex-shrink: 0;
}

.copy-btn:hover, .toggle-btn:hover {
    background: #333;
}

.password-masked {
    letter-spacing: 2px;
    color: #555 !important;
}

.expiry { color: #aaa !important; }
.remaining { color: #fff !important; }

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #fff;
    color: #000;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Navbar ===== */
.navbar {
    background: #111;
    border-bottom: 1px solid #2a2a2a;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.nav-right {
    display: flex;
    gap: 8px;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0;
    background: #111;
    border-bottom: 1px solid #2a2a2a;
    padding: 0 24px;
}

.tab {
    padding: 12px 24px;
    background: transparent;
    color: #666;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-size: 15px;
}

.tab.active {
    color: #fff;
    border-bottom-color: #fff;
}

.tab-content {
    display: none;
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.tab-content.active {
    display: block;
}

/* ===== Section Header ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 18px;
    color: #fff;
}

/* ===== Table ===== */
.table-wrap {
    overflow-x: auto;
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
}

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

thead {
    background: #0d0d0d;
}

th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    color: #777;
    font-weight: 600;
    border-bottom: 1px solid #2a2a2a;
}

td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid #1e1e1e;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: rgba(255, 255, 255, 0.02); }

.empty {
    text-align: center;
    color: #555;
    padding: 32px !important;
}

.mono {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 13px;
    color: #fff;
}

/* ===== Badge ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-ok {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.badge-expired {
    background: rgba(255, 255, 255, 0.05);
    color: #555;
}

/* ===== Filter Bar ===== */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-bar select {
    width: auto;
    min-width: 140px;
}

/* ===== Lookup Bar ===== */
.lookup-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.lookup-bar input {
    flex: 1;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    z-index: 1;
    max-width: 460px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #fff;
    font-size: 18px;
}

.modal-close {
    background: #222;
    border: none;
    color: #888;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover { background: #333; }

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: #777;
    margin-bottom: 6px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    /* Card */
    .card { padding: 20px 16px; border-radius: 12px; max-width: 100%; }
    .container { padding: 12px; }

    /* Logo */
    .logo { margin-bottom: 20px; }
    .logo-icon { font-size: 36px; margin-bottom: 8px; }
    .logo h1 { font-size: 20px; }

    /* Input */
    .input-group { gap: 8px; }
    input[type="text"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        padding: 10px 12px;
        font-size: 16px; /* prevent iOS zoom */
        border-radius: 8px;
    }
    button, .btn-primary { padding: 10px 18px; font-size: 14px; border-radius: 8px; }

    /* Result */
    .result { border-radius: 10px; margin-top: 16px; }
    .result-header { padding: 10px 12px; font-size: 14px; }
    .result-body { padding: 12px; }
    .result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 0;
    }
    .result-row label { width: auto; font-size: 12px; }
    .result-row .value { text-align: left; font-size: 14px; }
    .copy-wrap {
        flex-wrap: wrap;
        gap: 6px;
    }
    .copy-btn, .toggle-btn { padding: 6px 12px; font-size: 13px; }

    /* Info box */
    .info-box { padding: 12px 14px; margin-bottom: 16px; border-radius: 8px; }
    .info-text { font-size: 13px; line-height: 1.5; }

    /* Message */
    .message { font-size: 13px; margin-top: 8px; }

    /* Navbar */
    .navbar { padding: 10px 14px; }
    .nav-title { font-size: 15px; }
    .nav-right { gap: 6px; }
    .btn-small { padding: 5px 10px; font-size: 12px; }

    /* Tabs */
    .tabs { padding: 0 14px; }
    .tab { padding: 10px 16px; font-size: 14px; }

    /* Tab content */
    .tab-content { padding: 14px; }
    .section-header { margin-bottom: 12px; gap: 8px; }
    .section-header h2 { font-size: 16px; }

    /* Table */
    .table-wrap { border-radius: 10px; }
    th { padding: 8px 10px; font-size: 12px; }
    td { padding: 8px 10px; font-size: 13px; }
    .mono { font-size: 12px; }

    /* Filter */
    .filter-bar { gap: 8px; }
    .lookup-bar { flex-direction: column; gap: 8px; }
    .filter-bar select { min-width: 100px; font-size: 14px; }

    /* Modal */
    .modal-content { width: 95%; max-height: 85vh; }
    .modal-content.card { padding: 16px; }
    .modal-header h3 { font-size: 16px; }

    /* Toast */
    .toast { font-size: 13px; padding: 8px 18px; }
}

@media (max-width: 380px) {
    .card { padding: 16px 12px; }
    .logo h1 { font-size: 18px; }
    .input-group { flex-direction: column; }
    .input-group button { width: 100%; }
}
