/* Admin Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    width: 100%;
}

.login-box .logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-box .logo img {
    max-width: 200px;
    height: auto;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #333;
    font-size: 28px;
}

.login-box .subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.login-form {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #FF6B00;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary {
    padding: 10px 20px;
    background: white;
    color: #FF6B00;
    border: 2px solid #FF6B00;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #FF6B00;
    color: white;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 14px;
    display: none;
}

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

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

.info {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.info p {
    color: #666;
    font-size: 13px;
}

/* Admin Dashboard Styles */
.admin-container {
    min-height: 100vh;
    background: #f5f5f5;
}

.admin-header {
    background: #ffffff;
    color: #333;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content .logo img {
    height: 40px;
    width: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-email {
    font-size: 14px;
    opacity: 0.9;
}

.admin-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h1 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #333;
}

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

/* Status Filter Pills */
.status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.status-pill:hover {
    border-color: #ccc;
    background: #f8f9fa;
}

/* Active states - match status tag colors */
.status-pill.active[data-status="all"] {
    background: #FF6B00;
    border-color: #FF6B00;
    color: white;
}

.status-pill.active[data-status="Quoted"] {
    background: #dddee1;
    border-color: #dddee1;
    color: #000;
}

.status-pill.active[data-status="Awaiting Payment"] {
    background: #f9c84e;
    border-color: #f9c84e;
    color: #000;
}

.status-pill.active[data-status="Paid"] {
    background: #b3df72;
    border-color: #b3df72;
    color: #000;
}

.status-pill.active[data-status="Pre-order Reserved"] {
    background: #a8d4f0;
    border-color: #a8d4f0;
    color: #000;
}

.pill-count {
    font-weight: 600;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #FF6B00;
}

.filters-section {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.search-input {
    width: 350px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
}

.filter-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 12px 16px;
    padding-right: 2.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23333' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 6px;
    cursor: pointer;
    margin-left: auto;
}

/* Hide the legacy IE/Edge arrow */
.filter-select::-ms-expand {
    display: none;
}

.loading-state,
.error-state,
.empty-state {
    background: white;
    padding: 60px 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.error-state p,
.empty-state p {
    color: #666;
    margin-bottom: 20px;
}

.quotes-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
}

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

.quotes-table thead {
    background: #f8f9fa;
}

.quotes-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    border-bottom: 2px solid #FF6B00;
    white-space: nowrap;
}

.quotes-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.quotes-table tbody tr:hover {
    background: #f8f9fa;
}

.quote-value {
    font-weight: 600;
    color: #FF6B00;
}

.final-price {
    font-weight: 600;
    color: #333;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-sent {
    background: #d1ecf1;
    color: #0c5460;
}

/* Order Status Tags */
.status-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #000000;
    white-space: nowrap;
}

.status-quoted {
    background: #dddee1;
}

.status-awaiting-payment {
    background: #f9c84e;
}

.status-paid {
    background: #b3df72;
}

.status-preorder-reserved {
    background: #a8d4f0;
}

.preorder-price {
    color: #FF6B00;
    font-weight: 600;
}

.btn-edit {
    padding: 6px 16px;
    background: #FF6B00;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit:hover {
    background: #e65c00;
    transform: translateY(-1px);
}

.btn-edit-config,
.btn-view-stage {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #FF6B00;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit-config svg,
.btn-view-stage svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.btn-edit-config:hover,
.btn-view-stage:hover {
    background: #e65c00;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(255, 107, 0, 0.2);
}

.text-muted {
    color: #999;
    font-style: italic;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    font-size: 24px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

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

.modal-body {
    padding: 24px;
}

.readonly-field {
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    color: #333;
}

.calculated-field {
    padding: 12px 16px;
    background: #e7f3ff;
    border-radius: 6px;
    color: #0066cc;
    font-weight: 600;
    font-size: 18px;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

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

    .status-filters {
        gap: 8px;
    }

    .status-pill {
        padding: 6px 12px;
        font-size: 13px;
    }

    .filters-section {
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }

    .quotes-table {
        font-size: 12px;
    }

    .quotes-table th,
    .quotes-table td {
        padding: 10px 8px;
    }

    .modal-content {
        max-width: 100%;
    }
}

/* Pricing Page Styles */

/* Navigation */
.admin-nav {
    display: flex;
    gap: 30px;
    margin: 0 40px;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    font-size: 15px;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #FF6B00;
}

.nav-link.active {
    color: #FF6B00;
    border-bottom-color: #FF6B00;
}

/* Pricing Cards */
.pricing-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}

.card-header h2 {
    font-size: 18px;
    color: #333;
    margin: 0;
}

/* Admin Table (Shared/Updated) */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #666;
    font-size: 13px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
    vertical-align: middle;
}

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

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

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-base {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.badge-adder {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
}

/* Price Cell */
.price-cell {
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
    color: #333;
}

/* Icon Button */
.btn-icon {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #f0f0f0;
    color: #FF6B00;
}

.btn-icon .material-icons {
    font-size: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .admin-nav {
        margin: 10px 0;
        gap: 20px;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
}

/* Brand Button */
.btn-brand {
    padding: 10px 20px;
    background: #FF6B00;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-brand:hover {
    background: #e65c00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.2);
}

/* Reduced Table Padding */
.admin-table th,
.admin-table td {
    padding: 8px 16px; /* Reduced from 16px 20px */
}

/* Tabs / Slider */
.pricing-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.pricing-tab {
    padding: 16px 24px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.pricing-tab:hover {
    color: #333;
    background: #f0f0f0;
}

.pricing-tab.active {
    color: #FF6B00;
    border-bottom-color: #FF6B00;
    background: white;
}

/* Drag Handle */
.drag-handle {
    cursor: grab;
    color: #ccc;
    padding: 4px;
    display: flex;
    align-items: center;
}

.drag-handle:hover {
    color: #666;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-over {
    border-top: 2px solid #FF6B00;
}

/* Loading Spinner */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff6b00;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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