:root {
    /* Aligned with landing page (landing.css) */
    --bg-deep: #0c4a6e;
    --bg-hero: linear-gradient(165deg, #0c4a6e 0%, #134e4a 45%, #042f2e 100%);
    --primary-color: #14b8a6;
    --secondary-color: #0d9488;
    --accent-color: #5eead4;
    --gold: #d97706;
    --text-color: #0f172a;
    --text-light: #64748b;
    --background-color: #f1f5f9;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --shadow: 0 4px 6px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 50px -12px rgba(15, 23, 42, 0.12);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Cairo', sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
}

/* Buttons use system UI font by default — match page (Cairo) */
button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
    font-family: inherit;
    font-size: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 32px;
    padding: 28px 20px 24px;
    border-radius: var(--border-radius);
    background: var(--bg-hero);
    color: #fff;
    box-shadow: var(--shadow-lg);
}

.logo h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: #fff;
}

.logo p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.88);
}

/* Main Content */
.main-content {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    margin-bottom: 40px;
}

/* Form Styles */
.card-form {
    margin-bottom: 40px;
}

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

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="color"],
.form-group input[type="file"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group input[type="datetime-local"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.template-item {
    position: relative;
}

.template-item input[type="radio"] {
    display: none;
}

.template-item label {
    display: block;
    cursor: pointer;
    border: 3px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    background: var(--white);
}

.template-item label:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.template-item input[type="radio"]:checked + label {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.25);
}

.template-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.template-name {
    display: block;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: var(--text-color);
    background: var(--white);
}

.no-templates {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Image Position Preview */
.gv-img-position-wrap {
    margin-top: 14px;
    text-align: center;
}
.gv-img-position-hint {
    font-size: 0.85rem;
    color: var(--text-light, #64748b);
    margin: 0 0 8px;
    font-weight: 500;
}
.gv-img-position-box {
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    border: 2px solid var(--border-color, #e2e8f0);
    cursor: grab;
    touch-action: none;
    user-select: none;
    background: #f1f5f9;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.gv-img-position-box:active {
    cursor: grabbing;
    border-color: var(--primary-color, #14b8a6);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}
.gv-img-position-img {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
.gv-img-zoom-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px auto 0;
    max-width: 250px;
    direction: ltr;
}
.gv-img-zoom-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-light, #64748b);
    flex-shrink: 0;
}
.gv-img-zoom-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color, #e2e8f0);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.gv-img-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color, #14b8a6);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.gv-img-zoom-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color, #14b8a6);
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* Buttons */
.generate-btn, .download-btn, .share-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.35);
    color: var(--white);
    border: none;
    padding: 15px 30px;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Cairo', sans-serif;
    position: relative;
    overflow: hidden;
}

.generate-btn {
    width: 100%;
    padding: 20px;
    font-size: 1.2rem;
}

.generate-btn:hover, .download-btn:hover, .share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Result Section */
.result-section {
    text-align: center;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.generated-card {
    margin-bottom: 30px;
}

.generated-card canvas {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 100%;
    height: auto;
}

.download-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.download-btn {
    background: var(--success-color);
}

.share-btn {
    background: linear-gradient(135deg, var(--gold) 0%, #b45309 100%);
    color: #fff;
}

/* Footer */
.footer {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 8px;
}

/* Language Toggle Button */
.gv-lang-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1.5px solid rgba(15, 23, 42, 0.12);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    color: var(--text-color, #333);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    line-height: 1;
}
html[dir="rtl"] .gv-lang-toggle {
    left: auto;
    right: 16px;
}
.gv-lang-toggle:hover {
    background: var(--primary-color, #14b8a6);
    color: #fff;
    border-color: var(--primary-color, #14b8a6);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.15);
}
.gv-lang-toggle:hover svg {
    stroke: #fff;
}
.gv-lang-toggle:focus-visible {
    outline: 2px solid var(--primary-color, #14b8a6);
    outline-offset: 2px;
}
@media (max-width: 480px) {
    .gv-lang-toggle { padding: 8px 12px; font-size: 0.8rem; }
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn-loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .templates-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .download-section {
        flex-direction: column;
        align-items: center;
    }
    
    .download-btn, .share-btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .template-item img {
        height: 150px;
    }
}

/* Admin Styles */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.admin-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
}

.admin-nav {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.admin-nav a {
    padding: 10px 20px;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.admin-nav a:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.admin-nav a.active {
    background: var(--secondary-color);
}

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

.stat-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-label {
    color: var(--text-light);
    font-weight: 500;
}

.admin-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
}

.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th,
.admin-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--background-color);
    font-weight: 600;
    color: var(--text-color);
}

.admin-table tr:hover {
    background: var(--background-color);
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9rem;
    font-family: 'Cairo', sans-serif;
    margin: 0 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Login Form */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hero);
}

.login-form {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
}

.alert {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(20, 184, 166, 0.06);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(20, 184, 166, 0.12);
}

.upload-icon {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.upload-text {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 30px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

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

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 5px;
}

.close:hover {
    color: var(--text-color);
}

/* Template Editor Specific Styles */
.template-editor {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    margin-bottom: 30px;
    align-items: start;
}

/* Let preview column size to full image height (overflow:hidden on grid items can clip tall images) */
.template-editor > .preview-container {
    min-width: 0;
    min-height: min-content;
}

.preview-container {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: #f8f9fa;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* LTR: page is dir=rtl so flex "start" is on the right — without this, preview sits bottom-right */
.preview-container.has-image {
    direction: ltr;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    align-self: stretch;
    min-height: 400px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.preview-canvas {
    position: relative;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Shrink-wrap image so flex centering actually centers (full-width canvas can’t move horizontally in RTL) */
.preview-container.has-image .preview-canvas {
    width: fit-content;
    width: -moz-fit-content;
    max-width: 100%;
    margin: 0;
}

.preview-container.has-image .preview-image {
    width: auto;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    object-fit: contain;
}

.preview-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    object-fit: contain;
}

.text-overlay {
    position: absolute;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    cursor: move;
    user-select: none;
    pointer-events: all;
    border: 2px dashed transparent;
    padding: 5px;
    min-width: 50px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.text-overlay:hover {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.2);
}

.text-overlay.active {
    border-color: var(--primary-color);
    background: rgba(20, 184, 166, 0.15);
}

.text-field-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.text-field-item.active {
    border-color: var(--primary-color);
    background: rgba(20, 184, 166, 0.08);
}

.text-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Native details/summary accordion (reliable inside forms) */
.tpl-field-details {
    list-style: none;
}

.tpl-field-details > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    flex-wrap: wrap;
    list-style: none;
    padding: 0 0 12px 0;
    margin: 0;
}

.tpl-field-details > summary::-webkit-details-marker,
.tpl-field-details > summary::marker {
    display: none;
}

.tpl-field-details[open] > summary {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
    padding-bottom: 12px;
}

.accordion-chevron-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background: var(--border-color);
    border-radius: 6px;
    font-size: 0.7rem;
    line-height: 1;
    color: var(--text-color);
}

.tpl-field-details:not([open]) .accordion-chevron-icon::before {
    content: '▶';
}

.tpl-field-details[open] .accordion-chevron-icon::before {
    content: '▼';
}

.accordion-field-title {
    flex: 1;
    min-width: 0;
    text-align: right;
}

.tpl-field-details .accordion-body {
    padding-top: 4px;
}

.tpl-field-details .remove-field-btn {
    flex-shrink: 0;
}

.image-field-item {
    border-color: rgba(20, 184, 166, 0.35);
}

.image-slot-overlay.active {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    z-index: 12 !important;
}

.field-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.field-controls .form-group {
    margin-bottom: 10px;
}

.field-controls label {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.field-controls input,
.field-controls select {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.remove-field-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Cairo', sans-serif;
}

.add-field-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 20px;
    width: 100%;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 600;
}

.test-text-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.template-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--white);
    transition: all 0.3s ease;
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.template-preview {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(145deg, #e2e8f0 0%, #f1f5f9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.template-info {
    padding: 15px;
}

.template-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-edit {
    background: var(--primary-color);
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    font-family: 'Cairo', sans-serif;
    flex: 1;
    text-align: center;
}

.btn-edit:hover {
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
}

.coordinates-display {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 100;
}

.image-info {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
    pointer-events: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Error styles for form validation */
.error {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* Print Styles */
@media print {
    .admin-nav,
    .footer,
    .btn,
    button {
        display: none !important;
    }
    
    .admin-container {
        max-width: none;
        padding: 0;
    }
    
    .admin-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Additional responsive fixes */
@media (max-width: 1024px) {
    .template-editor {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        text-align: center;
    }
    
    .admin-nav {
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .field-controls {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------
   2026 Admin Theme Refresh (compact)
---------------------------------------- */
.admin-shell {
    --admin-scale: 0.93;
    --admin-surface: #ffffff;
    --admin-surface-soft: #f8fafc;
    --admin-border: #dbe5f1;
    --admin-ring: 0 0 0 3px rgba(20, 184, 166, 0.16);
    --admin-radius: 14px;
    font-size: 15px;
    background:
        radial-gradient(1100px 320px at 100% -8%, rgba(20, 184, 166, 0.12), transparent 55%),
        radial-gradient(900px 280px at 0% -10%, rgba(12, 74, 110, 0.1), transparent 52%),
        #f4f7fb;
    /* Adjust padding for sticky header */
    padding-top: 0;
}

.admin-shell .admin-container {
    max-width: 1500px;
    padding: 18px 18px 32px;
}

.admin-shell .admin-header {
    background: linear-gradient(145deg, #ffffff 0%, #f7fafc 100%);
    border: 1px solid var(--admin-border);
    border-radius: calc(var(--admin-radius) + 2px);
    box-shadow: 0 12px 30px -20px rgba(15, 23, 42, 0.45);
    padding: 20px;
    margin: 14px 18px;
    /* New header uses .topbar and .navbar instead */
    display: none;
}

/* --- New Header Integration --- */
.topbar + .navbar + .admin-container {
    margin-top: 0;
}

.topbar + .navbar {
    position: sticky;
    top: 57px; /* Height of topbar */
    z-index: 999;
}

.admin-shell .admin-title {
    font-size: calc(1.68rem * var(--admin-scale));
    letter-spacing: -0.01em;
}

.admin-shell .admin-nav {
    gap: 10px;
}

.admin-shell .admin-nav a {
    background: #eef6ff;
    border: 1px solid #d3e4f7;
    color: #0f3f61;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: calc(0.95rem * var(--admin-scale));
    font-weight: 700;
}

.admin-shell .admin-nav a:hover {
    background: #ddf3f0;
    border-color: #a8ddd6;
    color: #0b4f4a;
}

.admin-shell .admin-nav a.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 20px -14px rgba(20, 184, 166, 0.8);
}

.admin-shell .admin-section,
.admin-shell .stat-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    box-shadow: 0 10px 28px -20px rgba(15, 23, 42, 0.42);
}

.admin-shell .admin-section {
    padding: 20px;
    margin-bottom: 18px;
}

.admin-shell .section-title {
    font-size: calc(1.34rem * var(--admin-scale));
    margin-bottom: 14px;
}

.admin-shell .stats-grid {
    gap: 14px;
    margin-bottom: 18px;
}

.admin-shell .stat-card {
    padding: 22px 18px;
}

.admin-shell .stat-number {
    font-size: calc(2.15rem * var(--admin-scale));
    margin-bottom: 6px;
}

.admin-shell .stat-label {
    font-size: calc(0.92rem * var(--admin-scale));
}

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

.admin-shell .form-group label {
    font-size: calc(0.93rem * var(--admin-scale));
    margin-bottom: 6px;
}

.admin-shell .form-group input[type="text"],
.admin-shell .form-group input[type="email"],
.admin-shell .form-group input[type="password"],
.admin-shell .form-group input[type="number"],
.admin-shell .form-group input[type="color"],
.admin-shell .form-group input[type="file"],
.admin-shell .form-group input[type="datetime-local"],
.admin-shell .form-group select,
.admin-shell .form-group textarea {
    padding: 11px 13px;
    border: 1px solid var(--admin-border);
    border-radius: 11px;
    font-size: calc(0.95rem * var(--admin-scale));
    line-height: 1.45;
    background: var(--admin-surface-soft);
}

.admin-shell .form-group input:focus,
.admin-shell .form-group input[type="datetime-local"]:focus,
.admin-shell .form-group select:focus,
.admin-shell .form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: var(--admin-ring);
    background: #fff;
}

.admin-shell .generate-btn,
.admin-shell .download-btn,
.admin-shell .share-btn,
.admin-shell .btn-small,
.admin-shell .btn-edit,
.admin-shell .add-field-btn,
.admin-shell .remove-field-btn {
    border-radius: 11px;
    font-size: calc(0.92rem * var(--admin-scale));
}

.admin-shell .generate-btn,
.admin-shell .download-btn,
.admin-shell .share-btn {
    padding: 11px 18px;
    line-height: 1.2;
}

.admin-shell .generate-btn {
    font-size: calc(1rem * var(--admin-scale));
    padding: 12px 18px;
}

.admin-shell .share-btn {
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.25);
}

.admin-shell .btn-small,
.admin-shell .btn-edit {
    padding: 7px 12px;
}

.admin-shell .add-field-btn {
    padding: 10px 14px;
}

.admin-shell .remove-field-btn {
    padding: 6px 9px;
    border-radius: 9px;
}

.admin-shell .admin-table {
    margin-top: 10px;
}

.admin-shell .admin-table th,
.admin-shell .admin-table td {
    padding: 11px 10px;
    font-size: calc(0.9rem * var(--admin-scale));
}

.admin-shell .admin-table th {
    background: #f3f7fc;
}

.admin-shell .admin-table tr:hover {
    background: #f7fbff;
}

.admin-shell .alert {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: calc(0.9rem * var(--admin-scale));
}

.admin-shell .alert a {
    color: inherit;
    font-weight: 700;
}

.admin-shell .template-editor {
    gap: 18px;
}

.admin-shell .controls-panel {
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    background: var(--admin-surface-soft);
    padding: 14px;
}

.admin-shell .preview-container {
    border-radius: var(--admin-radius);
    border-color: var(--admin-border);
    min-height: 350px;
    background: #f6f9fc;
}

.admin-shell .preview-container.has-image {
    min-height: 350px;
    padding: 10px;
}

.admin-shell .template-card {
    border-color: var(--admin-border);
    border-radius: var(--admin-radius);
}

.admin-shell .template-info {
    padding: 12px;
}

.admin-shell .template-platform-hint {
    margin: -6px 0 16px;
    font-size: 0.9rem;
    color: var(--admin-muted, #64748b);
    line-height: 1.5;
}

.admin-shell .template-owner-line {
    margin: 0 0 8px;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--admin-text, #334155);
}

.admin-shell .badge-template-own {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    color: #fff;
}

.admin-shell .template-owner-label {
    color: var(--admin-muted, #64748b);
    margin-inline-end: 6px;
}

.admin-shell .template-owner-email {
    display: block;
    margin-top: 2px;
    font-size: 0.82rem;
    color: var(--admin-muted, #64748b);
    word-break: break-all;
}

.admin-shell .template-owner-unknown {
    color: var(--admin-muted, #64748b);
    font-size: 0.85rem;
}

.admin-shell .template-actions {
    gap: 8px;
    margin-top: 10px;
}

.admin-shell .text-field-item {
    border-color: var(--admin-border);
    border-radius: 11px;
    background: #fff;
    padding: 11px;
    margin-bottom: 10px;
}

.admin-shell .text-field-item.active {
    border-color: rgba(20, 184, 166, 0.6);
    background: rgba(20, 184, 166, 0.06);
}

.admin-shell .field-controls {
    gap: 8px;
}

.admin-shell .field-controls label,
.admin-shell .test-text-input {
    font-size: calc(0.84rem * var(--admin-scale));
}

.admin-shell .test-text-input {
    padding: 8px 10px;
    border: 1px solid var(--admin-border);
    border-radius: 9px;
    margin-bottom: 8px;
}

.admin-shell .coordinates-display,
.admin-shell .image-info {
    font-size: calc(0.74rem * var(--admin-scale));
    border-radius: 8px;
}

.admin-shell .modal-content {
    border-radius: var(--admin-radius);
    border: 1px solid var(--admin-border);
    box-shadow: 0 20px 45px -28px rgba(15, 23, 42, 0.55);
}

.admin-shell .code-block {
    display: block;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #0f172a;
    color: #e2e8f0;
    word-break: break-all;
}

.admin-shell .admin-note-card {
    margin-bottom: 14px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    padding: 14px;
}

.admin-shell .admin-note-text {
    margin-top: 8px;
    color: var(--text-light);
    font-size: calc(0.86rem * var(--admin-scale));
}

.admin-shell .quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-shell .inline-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-shell .grid-auto-300 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
}

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

.admin-shell .empty-state {
    text-align: center;
    padding: 28px;
    color: var(--text-light);
    background: #f8fafc;
    border: 1px dashed var(--admin-border);
    border-radius: 12px;
}

.admin-shell .status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: calc(0.78rem * var(--admin-scale));
    font-weight: 700;
    line-height: 1.2;
}

.admin-shell .status-pill.status-active {
    background: #dcfce7;
    color: #166534;
}

.admin-shell .status-pill.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.admin-shell .status-pill.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.admin-shell .btn-edit,
.admin-shell .btn-primary-small {
    background: var(--primary-color);
    color: #fff;
}

.admin-shell .btn-link-block {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.admin-shell .center-actions {
    text-align: center;
    margin-top: 16px;
}

.admin-shell .max-width-200 {
    max-width: 200px;
}

.admin-shell .max-width-420 {
    max-width: 420px;
}

.admin-shell .theme-editor {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 18px;
    margin-bottom: 0;
}

.admin-shell .preview-frame,
.admin-shell .settings-panel {
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    background: #fff;
}

.admin-shell .preview-frame {
    min-height: 560px;
    overflow: hidden;
}

.admin-shell .preview-frame iframe {
    width: 100%;
    height: 560px;
    border: 0;
}

.admin-shell .settings-panel {
    max-height: 560px;
    overflow-y: auto;
    padding: 14px;
}

.admin-shell .settings-section {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--admin-border);
}

.admin-shell .settings-section:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.admin-shell .settings-section h3 {
    color: #0f3f61;
    margin-bottom: 10px;
    font-size: calc(1rem * var(--admin-scale));
}

.admin-shell .color-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-shell .color-input-group input[type="color"] {
    width: 42px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
}

.admin-shell .color-input-group input[type="text"] {
    flex: 1;
    font-family: Consolas, "Courier New", monospace;
    background: #fff;
}

.admin-shell .logo-upload-area {
    border: 1px dashed var(--admin-border);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 10px;
}

.admin-shell .logo-upload-area:hover,
.admin-shell .logo-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(20, 184, 166, 0.08);
}

.admin-shell .upload-icon {
    font-size: 1.7rem;
    margin-bottom: 8px;
}

.admin-shell .upload-subhint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

.admin-shell .current-logo {
    margin-top: 10px;
    text-align: center;
}

.admin-shell .current-logo-label {
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-shell .current-logo img {
    max-width: 150px;
    max-height: 96px;
    border-radius: 10px;
    border: 1px solid var(--admin-border);
}

.admin-shell .hint {
    font-size: 0.84rem;
    color: var(--text-light);
}

.admin-shell .preview-note {
    margin: 10px 0 0;
    font-size: 0.84rem;
    color: var(--text-light);
}

.admin-shell .preview-note code {
    font-size: 0.8rem;
}

.admin-shell .preview-empty {
    padding: 30px;
    text-align: center;
    color: var(--text-light);
}

.admin-shell .settings-actions {
    text-align: center;
    margin-top: 18px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-shell .code-editor {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
}

.admin-login-shell {
    background: var(--bg-hero);
}

.admin-login-shell .login-container {
    padding: 18px;
}

.admin-login-shell .login-form {
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    box-shadow: 0 24px 40px -28px rgba(15, 23, 42, 0.75);
    padding: 28px;
    max-width: 390px;
}

.admin-login-shell .login-title {
    font-size: 1.6rem;
    margin-bottom: 20px;
}

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

.admin-login-shell .form-group label {
    margin-bottom: 6px;
    font-size: 0.94rem;
}

.admin-login-shell .form-group input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    font-size: 0.95rem;
}

.admin-login-shell .generate-btn {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
}

.admin-login-shell .back-link {
    margin-top: 14px;
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .admin-shell .theme-editor {
        grid-template-columns: 1fr;
    }

    .admin-shell .preview-frame {
        order: 2;
        min-height: 480px;
    }

    .admin-shell .preview-frame iframe {
        height: 480px;
    }

    .admin-shell .settings-panel {
        order: 1;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .admin-shell .admin-container {
        padding: 12px;
    }

    .admin-shell .admin-header {
        margin: 10px 12px;
        padding: 14px;
    }

    .admin-shell .admin-nav {
        justify-content: center;
        gap: 8px;
    }

    .admin-shell .admin-nav a {
        padding: 8px 12px;
    }

    .admin-shell .quick-actions .generate-btn,
    .admin-shell .quick-actions .share-btn {
        width: 100%;
        justify-content: center;
    }

    .admin-shell .grid-auto-300,
    .admin-shell .grid-auto-250 {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   NEW TWO-TIER HEADER (TOPBAR + NAVBAR)
   Inspired by control panel design
   ========================================= */

/* --- Top Bar: Brand & User Context --- */
.topbar {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--admin-border, #dbe5f1);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.topbar-inner {
    max-width: 1500px;
    margin: 0 auto;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Brand Section */
.topbar-brand {
    flex-shrink: 0;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.brand-link:hover {
    opacity: 0.85;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo svg {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 2px 4px rgba(20, 184, 166, 0.25));
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.brand-text strong {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0c4a6e;
    letter-spacing: -0.02em;
}

.brand-text small {
    font-size: 0.75rem;
    color: var(--text-light, #64748b);
    font-weight: 500;
}

/* Quick Links */
.topbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-link:hover {
    background: #f1f5f9;
    color: #0c4a6e;
}

.quick-link svg {
    opacity: 0.7;
}

.quick-link.whatsapp-link {
    color: #128c7e;
}

.quick-link.whatsapp-link:hover {
    background: #d1fae5;
}

/* User Area */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* User Badges (Cards Remaining, Plan) */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.cards-badge {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.cards-badge .badge-count {
    font-size: 0.9rem;
    font-weight: 800;
}

.cards-badge .badge-label {
    font-size: 0.7rem;
}

.plan-badge {
    border: 1px solid;
}

.plan-badge.plan-free {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #d1d5db;
}

.plan-badge.plan-weekly {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.plan-badge.plan-monthly {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

.plan-badge.plan-annual {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3);
}

/* Icon Buttons */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f1f5f9;
    border: none;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.icon-btn:hover {
    background: #e2e8f0;
    color: #0c4a6e;
}

.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    border: 1.5px solid #f1f5f9;
}

.notification-dot.urgent {
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 10px;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.user-trigger:hover {
    background: #e2e8f0;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #14b8a6 0%, #0c4a6e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px -10px rgba(15, 23, 42, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    z-index: 1001;
}

.user-dropdown:hover .dropdown-menu,
.user-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-header strong {
    display: block;
    font-size: 0.95rem;
    color: #1e293b;
    margin-bottom: 2px;
}

.dropdown-header span {
    font-size: 0.75rem;
    color: #64748b;
}

.dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 6px 0;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: #475569;
    text-decoration: none;
    transition: all 0.15s;
}

.dropdown-menu a:hover {
    background: #f8fafc;
    color: #0c4a6e;
}

.dropdown-menu a.logout-link {
    color: #dc2626;
}

.dropdown-menu a.logout-link:hover {
    background: #fef2f2;
    color: #b91c1c;
}

/* --- Navigation Bar: Main Menu --- */
.navbar {
    background: linear-gradient(145deg, #0c4a6e 0%, #0f172a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-inner {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.main-nav {
    display: flex;
    align-items: stretch;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: white;
    border-bottom-color: #14b8a6;
    background: rgba(20, 184, 166, 0.1);
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    margin-right: 6px;
    text-transform: uppercase;
}

.nav-badge.upgrade {
    background: #f59e0b;
    color: white;
    animation: pulse-upgrade 2s infinite;
}

@keyframes pulse-upgrade {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0); }
}

/* Navbar Actions */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.action-btn.preview-btn {
    background: rgba(20, 184, 166, 0.15);
    color: #5eead4;
    border: 1px solid rgba(20, 184, 166, 0.3);
}

.action-btn.preview-btn:hover {
    background: rgba(20, 184, 166, 0.25);
    border-color: rgba(20, 184, 166, 0.5);
}

.action-btn.logout-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.action-btn.logout-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

/* --- Mobile Navigation Toggle --- */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #14b8a6 0%, #0c4a6e 100%);
    border: none;
    color: white;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(20, 184, 166, 0.4);
    cursor: pointer;
    z-index: 1002;
}

/* --- Copy Link Toast --- */
.copy-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #0c4a6e;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 9999;
}

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

/* --- Hide Old Header --- */
.admin-header {
    display: none;
}

/* --- Responsive Styles --- */
@media (max-width: 1024px) {
    .topbar-inner {
        flex-wrap: wrap;
        gap: 12px;
    }

    .topbar-links {
        order: 3;
        width: 100%;
        justify-content: center;
        border-top: 1px solid #f1f5f9;
        padding-top: 10px;
    }

    .navbar-inner {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .navbar-inner::-webkit-scrollbar {
        display: none;
    }

    .main-nav {
        flex-wrap: nowrap;
    }

    .nav-item {
        white-space: nowrap;
        padding: 12px 14px;
    }

    .navbar-actions {
        display: none;
    }
}

@media (max-width: 768px) {
    .topbar-inner {
        padding: 10px 12px;
    }

    .brand-text small {
        display: none;
    }

    .cards-badge .badge-label {
        display: none;
    }

    .user-name {
        display: none;
    }

    .quick-link span {
        display: none;
    }

    .quick-link {
        padding: 8px;
    }

    .plan-badge {
        display: none;
    }

    .nav-label {
        font-size: 0.75rem;
    }

    .mobile-nav-toggle {
        display: flex;
    }
}

@media (max-width: 480px) {
    .topbar-links {
        display: none;
    }

    .topbar-user {
        margin-right: auto;
    }
}

/* =========================================
   DASHBOARD V2 - MODERN LAYOUT
   ========================================= */

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, #0c4a6e 0%, #14b8a6 100%);
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 24px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 0 10px 40px -10px rgba(12, 74, 110, 0.4);
}

.welcome-content h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: white;
}

.welcome-content p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
}

.welcome-plan {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.plan-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.plan-pill.plan-green {
    background: #10b981;
    border-color: #059669;
}

.plan-pill.plan-blue {
    background: #3b82f6;
    border-color: #2563eb;
}

.plan-pill.plan-yellow {
    background: #f59e0b;
    border-color: #d97706;
}

.cards-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Dashboard Stats Grid */
.dashboard-stats {
    margin-bottom: 24px;
}

.dashboard-stats .stat-card {
    position: relative;
    padding: 24px;
    border: none;
    overflow: hidden;
}

.dashboard-stats .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--stat-color, #14b8a6), var(--stat-color-light, #5eead4));
}

.dashboard-stats .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: rgba(20, 184, 166, 0.1);
    color: #14b8a6;
}

.dashboard-stats .stat-card.stat-primary { --stat-color: #14b8a6; --stat-color-light: #5eead4; }
.dashboard-stats .stat-card.stat-secondary { --stat-color: #3b82f6; --stat-color-light: #93c5fd; }
.dashboard-stats .stat-card.stat-accent { --stat-color: #f59e0b; --stat-color-light: #fcd34d; }
.dashboard-stats .stat-card.stat-success { --stat-color: #10b981; --stat-color-light: #6ee7b7; }

.dashboard-stats .stat-card.stat-secondary .stat-icon { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.dashboard-stats .stat-card.stat-accent .stat-icon { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.dashboard-stats .stat-card.stat-success .stat-icon { background: rgba(16, 185, 129, 0.1); color: #10b981; }

.dashboard-stats .stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
}

.dashboard-stats .stat-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.stat-trend {
    margin-top: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}

.stat-trend.up {
    color: #10b981;
}

.stat-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0c4a6e;
    text-decoration: none;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    transition: color 0.2s;
}

.stat-action:hover {
    color: #14b8a6;
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Dashboard Cards */
.dashboard-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafafa;
}

.card-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #14b8a6 0%, #0c4a6e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-header-icon.shortener-icon { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.card-header-icon.analytics-icon { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.card-header-icon.activity-icon { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.card-body {
    padding: 24px;
}

.card-description {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 16px;
}

/* URL Box */
.url-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.url-code {
    flex: 1;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    color: #0c4a6e;
    word-break: break-all;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0c4a6e;
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-preview,
.btn-edit,
.btn-generate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn-preview {
    background: #f1f5f9;
    color: #0c4a6e;
}

.btn-preview:hover {
    background: #e2e8f0;
}

.btn-edit {
    background: linear-gradient(135deg, #14b8a6 0%, #0c4a6e 100%);
    color: white;
}

.btn-edit:hover {
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
    transform: translateY(-1px);
}

.btn-generate {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
}

.btn-generate:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

/* Shortener Form */
.shortener-form {
    margin-bottom: 16px;
}

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

.shortener-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    background: white;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

/* Short URLs List */
.short-urls-list {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.short-urls-list h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 12px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid #f1f5f9;
}

.data-table th {
    font-weight: 600;
    color: #64748b;
    font-size: 0.8rem;
    background: #fafafa;
}

.data-table code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    color: #0c4a6e;
}

.data-table code.short-code {
    font-size: 0.75rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f1f5f9;
    color: #0c4a6e;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-soft {
    background: #f1f5f9;
    color: #475569;
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.analytic-box {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
}

.analytic-box h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin: 0 0 12px;
}

.mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 60px;
    padding: 8px 0;
}

.mini-chart .bar {
    flex: 1;
    background: linear-gradient(to top, #14b8a6, #5eead4);
    border-radius: 3px 3px 0 0;
    min-height: 4px;
    transition: opacity 0.2s;
}

.mini-chart .bar:hover {
    opacity: 0.8;
}

.analytic-total {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0c4a6e;
    margin: 12px 0 0;
}

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

.source-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #e2e8f0;
}

.source-list li:last-child {
    border-bottom: none;
}

.source-name {
    font-size: 0.8rem;
    color: #475569;
}

.source-count {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0c4a6e;
}

.no-data {
    font-size: 0.85rem;
    color: #94a3b8;
    font-style: italic;
}

.analytics-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin: 16px 0 0;
    padding-top: 16px;
    border-top: 1px dashed #e2e8f0;
}

.analytics-hint code {
    font-family: 'Consolas', 'Monaco', monospace;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
    transition: background 0.2s;
}

.activity-item:hover {
    background: #f1f5f9;
}

.activity-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.activity-item.visit .activity-icon-wrapper { background: #eff6ff; }
.activity-item.card .activity-icon-wrapper { background: #f0fdf4; }
.activity-item.login .activity-icon-wrapper { background: #fef3c7; }
.activity-item.upload .activity-icon-wrapper { background: #eff6ff; }
.activity-item.delete .activity-icon-wrapper { background: #fef2f2; }
.activity-item.link .activity-icon-wrapper { background: #faf5ff; }

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 2px;
}

.activity-details {
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.activity-clock {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
    direction: ltr;
    unicode-bidi: isolate;
}

.activity-time {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

.activity-ip {
    font-size: 0.7rem;
    color: #cbd5e1;
    font-family: 'Consolas', monospace;
    direction: ltr;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state svg {
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 0.9rem;
    color: #94a3b8;
    margin: 0;
}

.empty-state-sm {
    text-align: center;
    padding: 24px;
}

.empty-state-sm svg {
    margin-bottom: 8px;
}

.empty-state-sm p {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0;
}

/* Sidebar Cards */
.sidebar-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 24px;
}

.sidebar-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px;
}

.quick-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #475569;
    transition: all 0.2s;
}

.quick-link-item:hover {
    background: #f8fafc;
    color: #0c4a6e;
}

.quick-link-item.highlight {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.1) 0%, rgba(12, 74, 110, 0.05) 100%);
    border: 1px solid rgba(20, 184, 166, 0.2);
    color: #0c4a6e;
}

.quick-link-item.highlight:hover {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.15) 0%, rgba(12, 74, 110, 0.08) 100%);
}

.quick-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    flex-shrink: 0;
}

.quick-link-item:hover .quick-icon {
    background: #e2e8f0;
    color: #0c4a6e;
}

.quick-link-item.highlight .quick-icon {
    background: rgba(20, 184, 166, 0.15);
    color: #14b8a6;
}

.quick-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Help Card */
.help-card p {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 16px;
    line-height: 1.6;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-whatsapp:hover {
    box-shadow: 0 4px 12px rgba(18, 140, 126, 0.3);
    transform: translateY(-1px);
}

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

.pagination a {
    padding: 8px 14px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a:hover {
    background: #e2e8f0;
    color: #0c4a6e;
}

.pagination span {
    font-size: 0.85rem;
    color: #94a3b8;
}

.mt-3 { margin-top: 12px; }

/* =========================================
   TEMPLATES PAGE - TEMPLATE EDITOR
   ========================================= */

.templates-page .page-header {
    margin-bottom: 24px;
}

.templates-page .page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
}

.templates-page .page-title p {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

/* Template Editor Grid */
.template-editor {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
}

/* Preview Container */
.preview-container {
    background: #f8fafc;
    border-radius: 16px;
    min-height: 500px;
    position: relative;
    overflow: hidden;
    border: 2px dashed #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-container.has-image {
    border-style: solid;
    border-color: #e2e8f0;
    background: #0f172a;
}

.preview-container .empty-state {
    text-align: center;
    padding: 60px 20px;
}

.preview-container .empty-state .upload-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.preview-container .empty-state div {
    font-size: 1rem;
    color: #475569;
    margin-bottom: 8px;
}

.preview-container .empty-state .upload-subhint {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.6;
}

/* Coordinates Display */
.coordinates-display {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
    z-index: 100;
}

.image-info {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
    z-index: 100;
}

/* Controls Panel */
.controls-panel {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.controls-header {
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.controls-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.controls-body {
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
}

/* Template Form */
.template-form .form-group {
    margin-bottom: 16px;
}

.template-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.template-form input[type="text"],
.template-form input[type="number"],
.template-form select,
.template-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    background: white;
    transition: all 0.2s;
}

.template-form input:focus,
.template-form select:focus,
.template-form textarea:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fafc;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: #14b8a6;
    background: rgba(20, 184, 166, 0.05);
}

.file-upload-area svg {
    margin-bottom: 12px;
}

.file-upload-area p {
    font-size: 0.9rem;
    color: #475569;
    margin: 0 0 6px;
}

.file-upload-area span {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Add Field Button */
.add-field-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.add-field-btn:hover {
    background: #e2e8f0;
    color: #0c4a6e;
}

/* Text Field Item */
.text-field-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.text-field-item.active {
    border-color: #14b8a6;
    background: rgba(20, 184, 166, 0.05);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.text-field-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.field-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.text-field-item.active .field-number {
    background: #14b8a6;
    color: white;
}

.field-title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
}

/* Template Grid for List View */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.template-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    transition: all 0.2s;
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.1);
}

.template-preview {
    position: relative;
    height: 180px;
    background: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%);
    overflow: hidden;
}

.template-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-info {
    padding: 16px;
}

.template-info h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
}

.template-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 12px;
}

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

/* Responsive Templates */
@media (max-width: 1024px) {
    .template-editor {
        grid-template-columns: 1fr;
    }

    .preview-container {
        min-height: 350px;
    }

    .controls-panel {
        order: -1;
    }

    .controls-body {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* =========================================
   THEME EDITOR - DESIGNER
   ========================================= */

.theme-editor-page .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.btn-preview-external {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-preview-external:hover {
    background: #e2e8f0;
    color: #0c4a6e;
}

/* Editor Grid */
.theme-editor-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
}

/* Preview Panel */
.preview-panel {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 140px;
    height: fit-content;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.panel-header svg {
    color: #0c4a6e;
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    flex: 1;
}

.btn-refresh-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-refresh-preview:hover {
    background: #14b8a6;
    border-color: #14b8a6;
    color: white;
}

.preview-frame-wrapper {
    position: relative;
    height: 500px;
    background: #f8fafc;
}

.preview-frame-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
}

.preview-empty p {
    font-size: 1rem;
    color: #64748b;
    margin: 16px 0 8px;
}

.preview-empty span {
    font-size: 0.85rem;
    color: #94a3b8;
}

.preview-url {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #0f172a;
    border-top: 1px solid #e2e8f0;
}

.preview-url code {
    flex: 1;
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn-sm {
    padding: 6px 12px;
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn-sm:hover {
    background: rgba(255,255,255,0.2);
}

/* Settings Stack */
.settings-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Settings Card */
.settings-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #fafafa;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.settings-card-header:hover {
    background: #f1f5f9;
}

.section-icon {
    font-size: 1.2rem;
}

.settings-card-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    flex: 1;
}

.toggle-icon {
    font-size: 0.8rem;
    color: #94a3b8;
    transition: transform 0.2s;
}

.settings-card-body {
    padding: 20px;
    display: none;
}

.settings-card-body.open {
    display: block;
}

.settings-card:first-child .settings-card-body {
    display: block;
}

/* Color Grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.color-input-wrap label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.color-field {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.color-field input[type="color"] {
    width: 40px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
}

.color-value {
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
    color: #475569;
    flex: 1;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: #475569;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #14b8a6;
}

/* Logo Upload */
.logo-upload-wrap {
    margin: 16px 0;
}

.logo-upload-wrap > label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.logo-upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.logo-upload-box:hover,
.logo-upload-box.dragover {
    border-color: #14b8a6;
    background: rgba(20, 184, 166, 0.05);
}

.logo-upload-box p {
    font-size: 0.9rem;
    color: #475569;
    margin: 12px 0 4px;
}

.logo-upload-box span {
    font-size: 0.75rem;
    color: #94a3b8;
}

.current-logo-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px;
    background: #f1f5f9;
    border-radius: 10px;
}

.current-logo-preview span {
    font-size: 0.8rem;
    color: #64748b;
}

.current-logo-preview img {
    max-height: 50px;
    border-radius: 6px;
}

/* Form Row 2 */
.form-row-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Code Editor */
.code-editor {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.5;
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 10px;
    border: none;
    resize: vertical;
}

.code-editor:focus {
    outline: 2px solid #14b8a6;
}

/* Editor Actions */
.editor-actions {
    display: flex;
    justify-content: flex-end;
    padding: 8px 0 20px;
}

.btn-save-theme {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #14b8a6 0%, #0c4a6e 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-save-theme:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -8px rgba(20, 184, 166, 0.5);
}

/* Responsive Theme Editor */
@media (max-width: 1200px) {
    .theme-editor-grid {
        grid-template-columns: 1fr;
    }

    .preview-panel {
        position: relative;
        top: 0;
        order: -1;
    }

    .preview-frame-wrapper {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .theme-editor-page .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

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

    .btn-save-theme {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================
   USERS PAGE - USER MANAGEMENT
   ========================================= */

.users-page .page-header {
    margin-bottom: 20px;
}

/* Required field mark */
.required-mark {
    color: #ef4444;
    font-weight: 700;
}

/* WhatsApp input styling */
.form-group-wa .input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.form-group-wa .input-icon {
    position: absolute;
    left: 12px;
    font-size: 1.2rem;
    z-index: 2;
    pointer-events: none;
}

.form-group-wa .wa-input {
    padding-left: 42px !important;
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 0.5px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
}

.form-group-wa .wa-input:focus {
    background: #fff;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.form-group-wa .field-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #64748b;
}

/* Password input with generate button */
.password-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.password-input-wrapper input {
    flex: 1;
}

.btn-generate-password {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #14b8a6 0%, #0c4a6e 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.btn-generate-password:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.btn-generate-password:active {
    transform: translateY(0);
}

.users-page .page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
}

.users-page .page-title p {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

/* Stats Row */
.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    flex: 1;
    min-width: 160px;
}

.stat-mini-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-mini.stat-success .stat-mini-icon { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.stat-mini.stat-accent .stat-mini-icon { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.stat-mini-content {
    display: flex;
    flex-direction: column;
}

.stat-mini-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
}

.stat-mini-label {
    font-size: 0.8rem;
    color: #64748b;
}

/* Collapsible Card Header */
.card-header.collapsible {
    cursor: pointer;
}

.card-header.collapsible:hover {
    background: #f1f5f9;
}

.collapse-icon {
    margin-right: auto;
    margin-left: 0;
    font-size: 0.8rem;
    color: #94a3b8;
    transition: transform 0.2s;
}

/* User Form */
.user-form .form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.user-form .form-row-inline {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.user-form .form-group-small {
    flex: 0 0 200px;
}

.btn-submit-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #14b8a6 0%, #0c4a6e 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-submit-form:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

/* Table Styles */
.p-0 { padding: 0 !important; }

.table-container {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.users-table th {
    background: #f8fafc;
    padding: 14px 16px;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.users-table td {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.users-table tr:hover td {
    background: #fafafa;
}

.page-link-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.page-link-cell code {
    font-size: 0.85rem;
}

.btn-view-customer-page {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    color: #0f766e;
    background: #ccfbf1;
    border: 1px solid #99f6e4;
    transition: background 0.15s, color 0.15s;
}

.btn-view-customer-page:hover {
    background: #5eead4;
    color: #134e4a;
}

/* User Cell */
.user-info-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #14b8a6 0%, #0c4a6e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details strong {
    font-size: 0.95rem;
    color: #0f172a;
    font-weight: 600;
}

.user-details span {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Contact Cell */
.contact-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-cell span {
    font-size: 0.9rem;
    color: #475569;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.status-pending {
    background: #fef3c7;
    color: #92400e;
}

/* Activity Cell */
.activity-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.last-login {
    font-size: 0.85rem;
    color: #475569;
}

.join-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Actions Cell */
.actions-cell {
    display: flex;
    gap: 8px;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit-action {
    background: #f1f5f9;
    color: #64748b;
}

.btn-edit-action:hover {
    background: #14b8a6;
    color: white;
}

.btn-delete-action {
    background: #fef2f2;
    color: #ef4444;
    text-decoration: none;
}

.btn-delete-action:hover {
    background: #ef4444;
    color: white;
}

/* Modal Improvements */
.modal-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #14b8a6 0%, #0c4a6e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
}

.modal-header {
    display: flex;
    align-items: center;
}

.modal-header .close {
    margin-right: auto;
    margin-left: 0;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.btn-secondary {
    padding: 10px 20px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, #14b8a6 0%, #0c4a6e 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

/* Responsive Users */
@media (max-width: 1024px) {
    .user-form .form-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-row {
        flex-direction: column;
    }

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

    .user-form .form-row-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .user-form .form-group-small {
        flex: 1;
    }

    .btn-submit-form {
        width: 100%;
        justify-content: center;
    }

    .users-table th:nth-child(2),
    .users-table td:nth-child(2) {
        display: none;
    }

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

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

    .modal-actions .btn-secondary,
    .modal-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================
   BILLING PAGE - PLAN MANAGEMENT
   ========================================= */

.billing-page .page-header {
    margin-bottom: 24px;
}

.billing-page .page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
}

.billing-page .page-title p {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

/* Current Plan Card */
.current-plan-card {
    background: white;
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 32px;
    border: 2px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.current-plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
}

.current-plan-card.plan-gray::before { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }
.current-plan-card.plan-yellow::before { background: linear-gradient(90deg, #f59e0b, #fcd34d); }
.current-plan-card.plan-blue::before { background: linear-gradient(90deg, #3b82f6, #93c5fd); }
.current-plan-card.plan-green::before { background: linear-gradient(90deg, #10b981, #34d399); }

.plan-badge-current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
    margin-bottom: 20px;
}

.plan-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.plan-icon-large {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.current-plan-card.plan-green .plan-icon-large { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.current-plan-card.plan-blue .plan-icon-large { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.current-plan-card.plan-yellow .plan-icon-large { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }

.plan-title-section h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.plan-price .price {
    font-size: 2rem;
    font-weight: 800;
    color: #0c4a6e;
}

.plan-price .period {
    font-size: 1rem;
    color: #64748b;
}

/* Usage Section */
.plan-usage {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

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

.usage-header span {
    font-size: 0.9rem;
    color: #64748b;
}

.usage-header strong {
    font-size: 1.1rem;
    color: #0f172a;
}

.usage-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    background: linear-gradient(90deg, #14b8a6, #5eead4);
    border-radius: 999px;
    transition: width 0.5s ease;
}

.usage-hint {
    margin: 12px 0 0;
    font-size: 0.85rem;
    color: #64748b;
}

.usage-hint .text-warning {
    color: #f59e0b;
    font-weight: 600;
}

/* Plan Features */
.plan-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #475569;
}

.feature-item svg {
    color: #10b981;
    flex-shrink: 0;
}

.subscription-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fef3c7;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #92400e;
    margin-bottom: 20px;
}

.subscription-info svg {
    color: #f59e0b;
}

/* Upgrade Button */
.btn-upgrade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #14b8a6 0%, #0c4a6e 100%);
    color: white;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -8px rgba(20, 184, 166, 0.5);
}

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

.btn-manage {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-manage:hover {
    background: #e2e8f0;
    color: #0c4a6e;
}

.btn-upgrade-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-upgrade-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Section Heading */
.section-heading {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 32px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

/* Plans Grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.plan-option {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 2px solid #e2e8f0;
    position: relative;
    transition: all 0.2s;
}

.plan-option:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.1);
}

.plan-option .popular-badge {
    position: absolute;
    top: -2px;
    right: 24px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #14b8a6 0%, #0c4a6e 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0 0 10px 10px;
}

.plan-option-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.plan-option.plan-green .plan-option-icon { background: rgba(16, 185, 129, 0.1); }
.plan-option.plan-blue .plan-option-icon { background: rgba(59, 130, 246, 0.1); }
.plan-option.plan-yellow .plan-option-icon { background: rgba(245, 158, 11, 0.1); }

.plan-option h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
}

.plan-option-price {
    font-size: 2rem;
    font-weight: 800;
    color: #0c4a6e;
    margin-bottom: 16px;
}

.plan-option-price span {
    font-size: 0.95rem;
    font-weight: 500;
    color: #64748b;
}

.plan-option-features {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.plan-option-features li {
    padding: 8px 0;
    font-size: 0.85rem;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}

.plan-option-features li:last-child {
    border-bottom: none;
}

.btn-select-plan {
    display: block;
    width: 100%;
    padding: 12px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 10px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-select-plan:hover {
    background: linear-gradient(135deg, #14b8a6 0%, #0c4a6e 100%);
    color: white;
}

/* Admin Tools Section */
.admin-tools-section {
    margin-top: 40px;
}

.admin-tools-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 24px;
    border: 1px dashed #cbd5e1;
}

.admin-tools-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
}

.admin-tools-card > p {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 20px;
}

.admin-form .form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-form .form-group {
    flex: 1;
    min-width: 200px;
}

.admin-form .form-group-small {
    flex: 0 0 180px;
}

.admin-form .form-group-grow {
    flex: 2 1 280px;
    min-width: 240px;
}

.admin-form .form-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin: 8px 0 0;
    line-height: 1.4;
}

.admin-form .billing-no-customers {
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.billing-customer-select {
    max-height: 280px;
}

.admin-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.admin-form input,
.admin-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
}

.btn-generate-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 24px;
    background: #475569;
    color: white;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-generate-link:hover {
    background: #334155;
    transform: translateY(-1px);
}

/* Responsive Billing */
@media (max-width: 768px) {
    .current-plan-card {
        padding: 24px;
    }

    .plan-header {
        flex-direction: column;
        text-align: center;
    }

    .plan-features {
        grid-template-columns: 1fr;
    }

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

    .btn-manage,
    .btn-upgrade-sm {
        width: 100%;
    }

    .admin-form .form-group-small {
        flex: 1;
    }
}

/* Responsive Dashboard */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-card {
        flex: 1;
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .welcome-banner {
        padding: 20px 24px;
    }

    .welcome-content h1 {
        font-size: 1.3rem;
    }

    .welcome-plan {
        width: 100%;
    }

    .dashboard-stats .stat-card {
        padding: 20px;
    }

    .dashboard-stats .stat-number {
        font-size: 1.6rem;
    }

    .card-body {
        padding: 20px;
    }

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

    .activity-item {
        flex-wrap: wrap;
    }

    .activity-meta {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px dashed #e2e8f0;
    }
}

@media (max-width: 480px) {
    .welcome-banner {
        padding: 16px 20px;
    }

    .url-box {
        flex-direction: column;
        align-items: stretch;
    }

    .url-code {
        text-align: center;
        padding-bottom: 8px;
        border-bottom: 1px dashed #e2e8f0;
    }

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

    .btn-preview,
    .btn-edit {
        justify-content: center;
    }
}