/* ===== AUTH PAGES ===== */
.auth-body {
    background: linear-gradient(135deg, #f8f9ff 0%, #eef1ff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.auth-subtitle {
    text-align: center;
    color: #888;
    font-size: 15px;
    margin-bottom: 28px;
}

.auth-link {
    text-align: center;
    font-size: 14px;
    color: #888;
    margin-top: 20px;
}

.auth-link a {
    color: #4A55A2;
    font-weight: 600;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s;
    outline: none;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #4A55A2;
    box-shadow: 0 0 0 3px rgba(74, 85, 162, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-inline {
    display: flex;
    gap: 12px;
    align-items: center;
}

.form-inline input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.form-inline input:focus {
    border-color: #4A55A2;
}

.form-inline-action {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* ===== DASHBOARD ===== */
.dashboard-container {
    padding: 100px 0 40px;
    min-height: 100vh;
    background: #f8f9ff;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.plan-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.plan-free {
    background: #f0f0f0;
    color: #666;
}

.plan-paid {
    background: #e8ebff;
    color: #4A55A2;
}

.config-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.config-ok {
    background: #e6f9ed;
    color: #16a34a;
}

.config-pending {
    background: #fef3c7;
    color: #d97706;
}

.plan-unlimited {
    background: #fef3c7;
    color: #d97706;
}

.dash-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #eee;
}

.dash-card h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.pending-msg {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 16px 20px;
    color: #1a1a2e;
}

/* ===== API KEY ===== */
.api-key-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1e1e2e;
    padding: 14px 20px;
    border-radius: 10px;
}

.api-key-box code {
    flex: 1;
    color: #a6e3a1;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    word-break: break-all;
}

.btn-copy {
    background: #4A55A2;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.btn-copy:hover {
    background: #3a4592;
}

/* ===== PLAN DETAILS ===== */
.plan-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.plan-item {
    font-size: 14px;
    padding: 8px 0;
    color: #555;
}

.plan-item strong {
    color: #333;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: #fff;
    border-radius: 12px;
    padding: 4px;
    border: 1px solid #eee;
}

.tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}

.tab:hover {
    color: #4A55A2;
    background: #f8f9ff;
}

.tab.active {
    background: #4A55A2;
    color: #fff;
}

.tab-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4A55A2 !important;
    background: none !important;
    border: 1px dashed #4A55A2;
}

.tab-content {
    display: none;
}

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

/* ===== ADMIN TABLE ===== */
.table-wrapper {
    overflow-x: auto;
}

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

.admin-table th {
    background: #f5f5f5;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #eee;
}

.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.admin-table tbody tr:hover {
    background: #f8f9ff;
}

.admin-table tbody tr.row-inactive {
    background: #fef2f2;
}

.admin-table tbody tr.row-inactive:hover {
    background: #fee2e2;
}

.btn-small {
    background: #4A55A2;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.btn-small:hover {
    background: #3a4592;
}

.btn-small-outline {
    background: #fff;
    color: #4A55A2;
    border: 1px solid #4A55A2;
}

.btn-small-outline:hover {
    background: #4A55A2;
    color: #fff;
}

.btn-small-green {
    background: #16a34a;
}

.btn-small-green:hover {
    background: #15803d;
}

.status-ok {
    color: #16a34a;
    font-weight: 600;
}

.status-err {
    color: #dc2626;
    font-weight: 600;
}

/* ===== LOG FILTERS ===== */
.log-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 16px;
    background: #f8f9ff;
    border-radius: 12px;
}

.log-filters .form-group {
    flex: 1;
    min-width: 150px;
}

.log-filters select,
.log-filters input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.log-filters select:focus,
.log-filters input:focus {
    border-color: #4A55A2;
}

/* ===== DATE RANGE ===== */
.date-range {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.date-range input {
    border: none !important;
    border-radius: 0 !important;
    padding: 10px 8px;
    font-size: 13px;
    outline: none;
    flex: 1;
    min-width: 120px;
}

.date-range input:focus {
    background: #f8f9ff;
}

.date-separator {
    color: #aaa;
    font-size: 14px;
    padding: 0 4px;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ===== LOADING ===== */
.btn.loading, .btn-small.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.btn.loading::after, .btn-small.loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.table-loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-card h3 {
    margin-bottom: 20px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Dashboard */
    .dashboard-container {
        padding: 72px 0 24px;
    }
    .dashboard-container h1 {
        font-size: 22px;
    }

    /* Tabs: scroll horizontal */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 2px;
        padding: 3px;
    }
    .tab {
        padding: 10px 14px;
        font-size: 12px;
        white-space: nowrap;
        flex: none;
    }
    .tab-link {
        font-size: 12px !important;
    }

    /* Cards */
    .dash-card {
        padding: 20px;
        border-radius: 12px;
    }
    .dash-card h3 {
        font-size: 16px;
    }

    /* API Key */
    .api-key-box {
        flex-direction: column;
        gap: 10px;
        padding: 12px 14px;
    }
    .api-key-box code {
        font-size: 12px;
    }
    .btn-copy {
        width: 100%;
        text-align: center;
    }

    /* Plan details */
    .plan-details {
        grid-template-columns: 1fr;
    }
    .plan-item {
        font-size: 13px;
        padding: 6px 0;
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-inline {
        flex-direction: column;
    }
    .form-inline input {
        width: 100%;
    }
    .form-group input,
    .form-group select {
        font-size: 14px;
        padding: 10px 12px;
    }

    /* Tables */
    .admin-table {
        font-size: 11px;
    }
    .admin-table th,
    .admin-table td {
        padding: 8px 6px;
    }
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Navbar */
    .nav-right {
        gap: 8px;
    }
    .user-badge {
        font-size: 12px;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .plan-badge {
        font-size: 9px;
        padding: 3px 8px;
    }

    /* Log filters */
    .log-filters {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
    .log-filters .form-group {
        min-width: 100%;
    }

    /* Pagination */
    .pagination {
        gap: 8px;
        font-size: 13px;
    }

    /* Modal */
    .modal-card {
        margin: 16px;
        padding: 24px;
        max-width: calc(100% - 32px);
    }

    /* Pending msg */
    .pending-msg {
        flex-direction: column;
        gap: 10px;
        padding: 14px;
    }

    /* Buttons */
    .btn-small {
        padding: 5px 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .dashboard-container {
        padding: 60px 0 16px;
    }
    .dashboard-container .container {
        padding: 0 12px;
    }
    .dashboard-container h1 {
        font-size: 20px;
        margin-bottom: 4px !important;
    }
    .dashboard-container > .container > p {
        font-size: 13px;
        margin-bottom: 16px !important;
    }

    .dash-card {
        padding: 16px;
        margin-bottom: 16px;
    }

    .nav-right .btn {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }

    /* Auth pages (verify, forgot-password) */
    .auth-card {
        padding: 28px 20px;
        border-radius: 14px;
    }
    .auth-container {
        padding: 12px;
    }
    .auth-subtitle {
        font-size: 13px;
    }
}
