/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0a;
    color: #c0c0c0;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #888;
    text-decoration: none;
}

a:hover {
    color: #fff;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* ===== HEADER ===== */
.header {
    background: #111;
    border-bottom: 1px solid #222;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
}

.logo span {
    color: #555;
    font-weight: 300;
}

.nav {
    display: flex;
    gap: 2px;
    align-items: center;
    flex-wrap: wrap;
}

.nav a {
    color: #777;
    text-decoration: none;
    padding: 8px 16px;
    font-size: 13px;
    transition: all 0.15s;
    border-radius: 2px;
    letter-spacing: 0.3px;
}

.nav a:hover {
    color: #fff;
    background: #1a1a1a;
}

.nav a.active {
    color: #fff;
    background: #1a1a1a;
}

.nav .logout {
    color: #555;
    margin-left: 8px;
}

.nav .logout:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.08);
}

/* ===== MAIN ===== */
.main {
    flex: 1;
    padding: 40px 0;
}

/* ===== FOOTER ===== */
.footer {
    background: #111;
    border-top: 1px solid #222;
    padding: 20px 0;
    text-align: center;
    color: #444;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* ===== MESSAGES ===== */
.message {
    padding: 14px 20px;
    margin-bottom: 24px;
    border-left: 3px solid;
    font-size: 14px;
}

.message.success {
    background: rgba(46, 204, 113, 0.05);
    border-color: #2ecc71;
    color: #82e0aa;
}

.message.error {
    background: rgba(231, 76, 60, 0.05);
    border-color: #e74c3c;
    color: #f1948a;
}

.token-highlight {
    background: #1a1a1a;
    padding: 3px 10px;
    border-radius: 2px;
    font-family: 'Consolas', 'Courier New', monospace;
    color: #82e0aa;
    font-size: 13px;
    word-break: break-all;
}

/* ===== LOGIN ===== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
}

.login-box {
    background: #111;
    border: 1px solid #222;
    padding: 48px 40px;
    width: 100%;
    max-width: 380px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    color: #fff;
    font-size: 26px;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.login-header p {
    color: #555;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.login-header .line {
    width: 40px;
    height: 1px;
    background: #333;
    margin: 12px auto 0;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: #999;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 2px;
    color: #e0e0e0;
    font-size: 14px;
    transition: border-color 0.15s;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #444;
}

textarea {
    resize: vertical;
    font-family: inherit;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23555' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

select option {
    background: #1a1a1a;
}

input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== BUTTONS ===== */
button,
.btn-primary,
.btn-secondary,
.btn-delete,
.btn-edit,
.btn-regenerate,
.btn-small {
    padding: 10px 24px;
    border: none;
    border-radius: 2px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
    letter-spacing: 0.3px;
    font-family: inherit;
}

.btn-primary {
    background: #fff;
    color: #0a0a0a;
}

.btn-primary:hover {
    background: #e0e0e0;
}

.btn-secondary {
    background: #1a1a1a;
    color: #888;
    border: 1px solid #2a2a2a;
}

.btn-secondary:hover {
    background: #222;
    color: #fff;
}

.btn-delete {
    background: rgba(231, 76, 60, 0.08);
    color: #e74c3c;
    padding: 5px 14px;
    font-size: 12px;
}

.btn-delete:hover {
    background: rgba(231, 76, 60, 0.15);
}

.btn-edit {
    background: rgba(255, 255, 255, 0.04);
    color: #999;
    padding: 5px 14px;
    font-size: 12px;
}

.btn-edit:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.btn-regenerate {
    background: rgba(241, 196, 15, 0.08);
    color: #f1c40f;
    padding: 5px 14px;
    font-size: 12px;
}

.btn-regenerate:hover {
    background: rgba(241, 196, 15, 0.15);
}

.btn-small {
    padding: 6px 16px;
    font-size: 12px;
    background: rgba(52, 152, 219, 0.08);
    color: #5dade2;
}

.btn-small:hover {
    background: rgba(52, 152, 219, 0.15);
}

.btn-full {
    width: 100%;
}

.btn-token {
    background: rgba(52, 152, 219, 0.08);
    color: #5dade2;
    padding: 3px 12px;
    font-size: 12px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-family: inherit;
}

.btn-token:hover {
    background: rgba(52, 152, 219, 0.15);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* ===== FORM CARDS ===== */
.form-card {
    background: #111;
    border: 1px solid #222;
    padding: 32px;
    max-width: 700px;
}

.form-card-wide {
    background: #111;
    border: 1px solid #222;
    padding: 32px;
    max-width: 900px;
}

/* ===== CHECKBOX GRID ===== */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
    margin-top: 6px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #1a1a1a;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 2px;
}

.checkbox-item:hover {
    background: #222;
}

.checkbox-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #fff;
    cursor: pointer;
}

.checkbox-item span {
    color: #aaa;
    font-size: 13px;
}

/* ===== TABLES ===== */
.table-responsive {
    overflow-x: auto;
    background: #111;
    border: 1px solid #222;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead {
    background: #0d0d0d;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    color: #666;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid #1a1a1a;
}

.data-table td {
    padding: 12px 16px;
    border-top: 1px solid #161616;
    color: #bbb;
}

.data-table tr:hover td {
    background: #0d0d0d;
}

.data-table code {
    background: #1a1a1a;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 12px;
    color: #999;
    font-family: 'Consolas', 'Courier New', monospace;
}

.data-table .token-hidden {
    display: none;
}

.data-table .token-code {
    font-size: 12px;
    color: #82e0aa;
    background: #1a1a1a;
    padding: 3px 10px;
    border-radius: 2px;
    word-break: break-all;
    font-family: 'Consolas', 'Courier New', monospace;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(46, 204, 113, 0.08);
    color: #82e0aa;
}

.status-badge.inactive {
    background: rgba(231, 76, 60, 0.08);
    color: #f1948a;
}

.method-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 600;
    background: #1a1a1a;
    color: #666;
    letter-spacing: 0.5px;
}

.field-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 11px;
    background: #1a1a1a;
    color: #888;
    margin: 2px;
}

.field-required {
    color: #e74c3c;
    font-weight: 600;
}

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

.action-buttons form {
    display: inline;
}

/* ===== DASHBOARD ===== */
.dashboard {
    max-width: 1000px;
}

.dashboard h1 {
    color: #fff;
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 32px;
}

.dashboard h1 small {
    color: #555;
    font-size: 14px;
    font-weight: 300;
    margin-left: 12px;
}

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

.stat-card {
    background: #111;
    border: 1px solid #222;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    font-size: 18px;
    font-weight: 300;
    color: #555;
    letter-spacing: 1px;
}

.stat-content h3 {
    color: #666;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.stat-number {
    color: #fff;
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.quick-actions {
    margin-top: 16px;
}

.quick-actions h2 {
    color: #777;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.action-card {
    background: #111;
    border: 1px solid #222;
    padding: 24px;
    text-align: center;
    text-decoration: none;
    color: #888;
    transition: all 0.15s;
    display: block;
}

.action-card:hover {
    border-color: #444;
    background: #161616;
    color: #fff;
}

.action-icon {
    display: block;
    font-size: 22px;
    font-weight: 300;
    margin-bottom: 8px;
    letter-spacing: 2px;
    color: #555;
}

.action-card:hover .action-icon {
    color: #fff;
}

.action-card span:last-child {
    font-size: 13px;
    letter-spacing: 0.3px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #666;
}

.empty-state p {
    margin-bottom: 16px;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.empty-state .btn-primary {
    padding: 10px 32px;
}

/* ===== PAGE TITLE ===== */
.page-title {
    color: #fff;
    font-size: 22px;
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 24px;
}

.text-muted {
    color: #666;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.text-muted a {
    color: #888;
    text-decoration: none;
    border-bottom: 1px dotted #333;
}

.text-muted a:hover {
    color: #fff;
    border-bottom-color: #666;
}

small {
    color: #555;
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

.field-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: #1a1a1a;
    margin-bottom: 8px;
    border-radius: 2px;
}

.field-row .field-info {
    flex: 1;
}

.field-row .field-info strong {
    color: #fff;
}

.field-row .field-info .field-desc {
    color: #666;
    font-size: 12px;
}

/* ===== API INFO BOX ===== */
.api-info-box {
    background: #0d0d0d;
    border: 1px solid #222;
    padding: 16px;
    margin: 16px 0;
    border-radius: 2px;
}

.api-info-box code {
    background: #1a1a1a;
    padding: 2px 8px;
    border-radius: 2px;
    color: #82e0aa;
    font-size: 13px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        height: auto;
        padding: 12px 0;
        gap: 12px;
    }

    .nav {
        justify-content: center;
    }

    .nav a {
        padding: 6px 12px;
        font-size: 12px;
    }

    .login-box {
        padding: 32px 24px;
    }

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

    .action-grid {
        grid-template-columns: 1fr;
    }

    .form-card,
    .form-card-wide {
        padding: 20px;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .data-table th,
    .data-table td {
        padding: 8px 12px;
        font-size: 12px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }

    .action-buttons form {
        display: inline-block;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn-secondary {
        text-align: center;
    }

    .field-row {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .header {
        padding: 0 12px;
    }

    .nav a {
        padding: 4px 10px;
        font-size: 11px;
    }

    .data-table {
        font-size: 11px;
    }

    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-number {
        font-size: 22px;
    }
}