/* ═══════════════════════════════════════════════════════════════
   Formatless - Production Stylesheet
   KB Gold / White Theme — clean financial aesthetic
   ═══════════════════════════════════════════════════════════════ */

/* ─── Google Fonts (loaded in HTML <head>) ────────────────────── */
/* font-family: 'Outfit', sans-serif  —  sleek, sharp, modern     */

/* ─── Design Tokens ──────────────────────────────────────────── */
:root {
    --gold:        #DAAB00;
    --gold-dark:   #B8960C;
    --gold-hover:  #C69C00;
    --bg:          #FFFFFF;
    --bg-soft:     #FAFAF6;
    --bg-warm:     #FBF9F0;
    --bg-hover:    #FEFCF3;
    --text:        #1A1A1A;
    --text-mid:    #555555;
    --text-light:  #888888;
    --text-muted:  #BBBBBB;
    --border:      #E5E0D0;
    --border-input:#D5D0C0;
    --danger:      #D9534F;
    --bg-card:     #FFFFFF;

    /* Unified sizing */
    --h-input:     38px;     /* height for all inputs, selects, sm buttons */
    --h-btn:       42px;     /* height for regular buttons */
    --radius:      4px;      /* consistent border-radius */
    --gap:         12px;     /* standard gap */
    --gap-sm:      8px;
    --font-sm:     13px;
    --font-base:   14px;
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--gold-dark);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--gold);
}

/* ─── Container ───────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* ─── Hero (Landing Page) ─────────────────────────────────────── */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    position: relative;
    background: linear-gradient(160deg, #FFFDE6 0%, #FFFFFF 40%, #FFF9E0 100%);
}

.hero-content {
    width: 100%;
    max-width: 420px;
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 46px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 8px;
    color: var(--gold);
}

.hero-subtitle {
    color: #777777;
    font-size: 16px;
    margin-bottom: 48px;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}

.copyright {
    position: absolute;
    bottom: 24px;
    font-size: 12px;
    color: #AAAAAA;
}

/* ─── Auth Pages ──────────────────────────────────────────────── */
.auth-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    background: linear-gradient(160deg, #FFFDE6 0%, #FFFFFF 40%, #FFF9E0 100%);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 40px 32px;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.auth-title {
    font-family: 'Outfit', sans-serif;
    text-align: center;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    color: var(--gold);
}

.auth-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 28px;
    font-size: var(--font-base);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: var(--font-sm);
    color: var(--text-light);
}

.auth-footer a {
    color: var(--gold);
    font-weight: 600;
    border-bottom: 1px solid rgba(218, 171, 0, 0.3);
}

.auth-footer a:hover {
    color: var(--gold-dark);
    border-color: var(--gold-dark);
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS — unified height & alignment
   ═══════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--h-btn);
    padding: 0 20px;
    font-size: var(--font-base);
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--border-input);
    border-radius: var(--radius);
    background: #F8F7F2;
    color: #333333;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
}

.btn:hover {
    background: #EFEDE4;
    border-color: #C0BB9F;
    color: var(--text);
}

.btn-primary {
    background: var(--gold);
    color: #FFFFFF;
    border-color: var(--gold);
}

.btn-primary:hover {
    background: var(--gold-hover);
    border-color: var(--gold-hover);
    color: #FFFFFF;
}

.btn-secondary {
    background: var(--bg);
    color: var(--gold);
    border-color: var(--gold);
}

.btn-secondary:hover {
    background: #FFFBE5;
    border-color: var(--gold-hover);
    color: var(--gold-hover);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-input);
    color: #777777;
}

.btn-outline:hover {
    background: #F8F7F2;
    border-color: var(--gold);
    color: var(--gold);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    height: var(--h-input);
    padding: 0 14px;
    font-size: var(--font-sm);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 15px;
    padding: 0;
    transition: all 0.15s;
    vertical-align: middle;
}

.btn-icon:hover {
    background: #F5F3EA;
    border-color: var(--border-input);
}

.btn-icon.btn-danger:hover {
    background: #FFF0F0;
    border-color: #FFAAAA;
}

/* ═══════════════════════════════════════════════════════════════
   FORM ELEMENTS — unified height to match .btn-sm
   ═══════════════════════════════════════════════════════════════ */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 5px;
    line-height: 1.3;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
    width: 100%;
    height: var(--h-btn);
    padding: 0 14px;
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border-input);
    border-radius: var(--radius);
    font-size: var(--font-base);
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    line-height: 1;
}

textarea {
    height: auto;
    padding: 11px 14px;
    line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--gold);
    background: var(--bg);
    box-shadow: 0 0 0 3px rgba(218, 171, 0, 0.12);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23DAAB00' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* Small variant — same height as .btn-sm */
.input-sm,
.filter-bar input,
.filter-bar select {
    height: var(--h-input);
    padding: 0 12px;
    font-size: var(--font-sm);
}

.file-input {
    width: 100%;
    height: var(--h-input);
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-soft);
    color: #777777;
    border: 1px dashed var(--border-input);
    border-radius: var(--radius);
    font-size: var(--font-sm);
    cursor: pointer;
}

.file-input:hover {
    border-color: var(--gold);
}

/* Auth / full-width submit buttons */
button[type="submit"],
.form-group button {
    width: 100%;
    height: var(--h-btn);
    padding: 0 16px;
    background: var(--gold);
    color: #FFFFFF;
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    font-size: var(--font-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    line-height: 1;
}

button[type="submit"]:hover,
.form-group button:hover {
    background: var(--gold-hover);
    border-color: var(--gold-hover);
}

/* ─── Top Bar ─────────────────────────────────────────────────── */
.topbar {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

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

.topbar-title {
    font-family: 'Outfit', sans-serif;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--gold);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-user {
    font-size: var(--font-sm);
    color: var(--text-light);
}

/* ─── Stats Grid ──────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    border-top: 3px solid var(--gold);
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-value.profit {
    color: var(--gold);
}

.stat-value.expense {
    color: var(--danger);
}

/* ─── Cards ───────────────────────────────────────────────────── */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    min-height: 52px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}

.card-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.toggle-icon {
    color: var(--gold);
    font-size: 11px;
}

.card-body {
    padding: 20px;
}

/* ─── Sales Form Grid ─────────────────────────────────────────── */
.sale-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

/* Unified input style inside sales form — covers every field type */
.sale-form-grid input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.sale-form-grid select,
.sale-form-grid textarea {
    width: 100%;
    height: var(--h-btn);
    padding: 0 14px;
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border-input);
    border-radius: var(--radius);
    font-size: var(--font-base);
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    line-height: 1;
}

.sale-form-grid textarea {
    height: auto;
    padding: 11px 14px;
    line-height: 1.5;
}

.sale-form-grid input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.sale-form-grid select:focus,
.sale-form-grid textarea:focus {
    border-color: var(--gold);
    background: var(--bg);
    box-shadow: 0 0 0 3px rgba(218, 171, 0, 0.12);
}

.sale-form-grid select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23DAAB00' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.sale-form-grid .full-width {
    grid-column: 1 / -1;
}

.sale-form-grid .span-2 {
    grid-column: span 2;
}

/* Submit button inside the grid should NOT stretch to full row width */
.sale-form-grid .form-group button[type="submit"] {
    height: var(--h-btn);
}

.help-text {
    font-size: 12px;
    color: #999999;
    margin-top: 10px;
    line-height: 1.5;
}

/* ─── Chart ───────────────────────────────────────────────────── */
.chart-controls {
    display: flex;
    gap: var(--gap);
    margin-bottom: 16px;
    align-items: center;
}

.chart-controls select {
    width: auto;
    min-width: 110px;
    height: var(--h-input);
    font-size: var(--font-sm);
}

.chart-wrapper {
    position: relative;
    height: 280px;
}

/* ═══════════════════════════════════════════════════════════════
   FILTER BAR — all items same height, aligned on one line
   ═══════════════════════════════════════════════════════════════ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap-sm);
    margin-bottom: 16px;
    align-items: center;      /* vertical center */
}

.filter-bar input,
.filter-bar select {
    width: auto;
    min-width: 120px;
    flex: 1;
}

.filter-bar .btn {
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   DATA TABLE — consistent cells, aligned actions
   ═══════════════════════════════════════════════════════════════ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-sm);
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
}

.data-table th {
    background: var(--bg-warm);
    color: var(--gold-dark);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.data-table td {
    color: #333333;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

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

.data-table .profit {
    color: var(--gold-dark);
    font-weight: 600;
}

.data-table .actions-col {
    width: 80px;
    text-align: center;
    white-space: nowrap;
}

/* Actions cell: buttons sit side by side, centered */
.data-table .actions-col .btn-icon,
.data-table .actions-col .inline-form {
    display: inline-flex;
    vertical-align: middle;
}

.empty-row {
    text-align: center !important;
    color: var(--text-muted) !important;
    padding: 30px !important;
}

.memo-cell {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    background: #F5F3EA;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    color: #777777;
    line-height: 1.3;
    vertical-align: middle;
}

.badge-pay {
    background: #FFFBE5;
    border-color: #F0E0A0;
    color: var(--gold-dark);
}

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

/* ─── Pagination ──────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: var(--bg-soft);
    border: 1px solid var(--border-input);
    border-radius: var(--radius);
    color: #777777;
    font-size: var(--font-sm);
    text-decoration: none;
    transition: all 0.15s;
    line-height: 1;
}

.page-btn:hover {
    background: #FFF9E0;
    border-color: var(--gold);
    color: var(--gold);
}

.page-btn.active {
    background: var(--gold);
    color: #FFFFFF;
    border-color: var(--gold);
    font-weight: 700;
}

.page-info {
    font-size: var(--font-sm);
    color: #999999;
    margin-left: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   DATA MANAGEMENT — equal height columns, aligned buttons
   ═══════════════════════════════════════════════════════════════ */
.data-mgmt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;      /* equal height columns */
}

.mgmt-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* push button to bottom */
    gap: var(--gap-sm);
    padding: 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.mgmt-item h3 {
    font-size: var(--font-base);
    margin: 0;
    color: var(--gold-dark);
    font-weight: 600;
}

.mgmt-item .help-text {
    margin: 0;
    font-size: 12px;
}

.mgmt-item form {
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
    margin-top: auto; /* push form to bottom of card */
}

.mgmt-item .file-input {
    display: flex;
    align-items: center;
    justify-content: center;   /* center the file button text */
}

.mgmt-item button[type="submit"] {
    height: var(--h-input);
    font-size: var(--font-sm);
    border-radius: var(--radius);
}

/* ═══════════════════════════════════════════════════════════════
   UPLOAD FORM — items aligned on one row
   ═══════════════════════════════════════════════════════════════ */
.upload-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--gap);
}

.upload-form input[type="file"] {
    flex: 1;
    min-width: 200px;
}

.upload-form button {
    width: auto;
    flex-shrink: 0;
    height: var(--h-input);
    padding: 0 20px;
    font-size: var(--font-sm);
    border-radius: var(--radius);
}

.upload-form .help-text {
    margin: 0;
}

/* ─── Flash Messages ──────────────────────────────────────────── */
.flash {
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: var(--font-base);
    border: 1px solid;
    border-radius: var(--radius);
}

.flash-success {
    background: #F0FFF0;
    border-color: #B0E0B0;
    color: #2A7A2A;
}

.flash-error {
    background: #FFF0F0;
    border-color: #EAADAD;
    color: #A03030;
}

.flash-warning {
    background: #FFFBE5;
    border-color: #F0E0A0;
    color: #8A7000;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL — aligned form rows
   ═══════════════════════════════════════════════════════════════ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
}

.modal-content {
    position: relative;
    background: var(--bg);
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    z-index: 1;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 17px;
    color: var(--gold);
    margin: 0;
    font-weight: 700;
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: #AAAAAA;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s;
}

.modal-close:hover {
    color: var(--gold);
    background: #FFF9E0;
    border-color: var(--border);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sale-form-grid {
        grid-template-columns: 1fr;
    }

    .sale-form-grid .span-2 {
        grid-column: span 1;
    }

    .data-mgmt-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar input,
    .filter-bar select {
        width: 100%;
        min-width: unset;
    }

    .filter-bar .btn {
        width: 100%;
    }

    .topbar-user {
        display: none;
    }

    .stat-value {
        font-size: 18px;
    }

    .chart-wrapper {
        height: 220px;
    }

    .upload-form {
        flex-direction: column;
        align-items: stretch;
    }

    .upload-form button {
        width: 100%;
    }

    .modal-content {
        margin: 16px;
        max-width: calc(100% - 32px);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 12px 10px 30px;
    }

    .card-body {
        padding: 14px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .page-btn {
        min-width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

/* ─── Custom Fields Manager ──────────────────────────────────── */
.cf-add-form {
    margin-bottom: 16px;
}

.cf-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.cf-name-input {
    flex: 1;
    min-width: 180px;
}

.cf-type-select {
    width: auto !important;
    min-width: 110px;
    flex-shrink: 0;
}

.cf-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.cf-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-input);
    border-radius: 6px;
    transition: border-color 0.2s;
}

.cf-item:hover {
    border-color: var(--gold);
}

.cf-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cf-item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.cf-item-type {
    font-size: 11px;
    padding: 2px 8px;
}

.btn-danger-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #d9534f;
    background: transparent;
    color: #d9534f;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1.4;
}

.btn-danger-outline:hover {
    background: #d9534f;
    color: #fff;
}

/* ─── Form Row Divider (Edit Modal) ─────────────────────────── */
.form-row-divider {
    font-size: 12px;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 14px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-input);
}

@media (max-width: 600px) {
    .cf-add-row {
        flex-direction: column;
        align-items: stretch;
    }
    .cf-type-select {
        width: 100% !important;
    }
    .cf-name-input {
        min-width: 100%;
    }
}

/* ─── Settings Page ──────────────────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.settings-col {
    display: flex;
    flex-direction: column;
}

.settings-section {
    padding: 20px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.settings-section h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PRO BADGE & PREMIUM LOCK
   ═══════════════════════════════════════════════════════════════ */
.pro-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #DAAB00, #F5D000);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 8px;
    text-transform: uppercase;
    line-height: 1.6;
    box-shadow: 0 1px 3px rgba(218, 171, 0, 0.3);
}

.premium-lock {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
}

.premium-lock-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.7;
}

.premium-lock-text {
    font-size: var(--font-base);
    color: var(--text-mid);
    line-height: 1.6;
}

.premium-lock-text strong {
    color: var(--gold);
}

/* ═══════════════════════════════════════════════════════════════
   SUBSCRIPTION SECTION (Settings Page)
   ═══════════════════════════════════════════════════════════════ */
.sub-section {
    border-left: 3px solid var(--gold);
}

.sub-status-card {
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.sub-plan-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.sub-plan-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.sub-plan-desc {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

.sub-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.sub-active {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.sub-warn {
    background: #FFF3E0;
    color: #E65100;
    border: 1px solid #FFE0B2;
}

.sub-cancelled {
    background: #FAFAFA;
    color: #999999;
    border: 1px solid #E0E0E0;
}

.sub-inactive {
    background: #F5F3EA;
    color: #999999;
    border: 1px solid var(--border);
}

.sub-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.sub-detail-label {
    color: var(--text-light);
}

.sub-detail-value {
    color: var(--text);
}

.sub-features {
    margin-bottom: 8px;
}

.sub-feature-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

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

.sub-feature-list li {
    font-size: 13px;
    padding: 5px 0 5px 22px;
    position: relative;
    color: var(--text-light);
}

.sub-feature-list li::before {
    content: "✕";
    position: absolute;
    left: 0;
    color: #CCCCCC;
    font-size: 12px;
    font-weight: 700;
}

.sub-feature-list li.active {
    color: var(--text);
}

.sub-feature-list li.active::before {
    content: "✓";
    color: #2E7D32;
}

/* ─── Utility ─────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.hidden { display: none; }

/* ─── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #F5F3EA;
}

::-webkit-scrollbar-thumb {
    background: var(--border-input);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* ─── Selection ───────────────────────────────────────────────── */
::selection {
    background: rgba(218, 171, 0, 0.2);
    color: var(--text);
}
