* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dashboard-body {
    background: #f0f2f5;
    display: block;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 500px;
    margin: 0 auto;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 10px;
    font-size: 32px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
}

.btn-success {
    background: #28a745;
}

.btn-danger {
    background: #dc3545;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-info {
    background: #17a2b8;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
}

.btn-lg {
    padding: 16px 24px;
    font-size: 18px;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
}

.auth-links p {
    margin-bottom: 10px;
    color: #666;
}

.link {
    display: block;
    color: #667eea;
    text-decoration: none;
    margin: 5px 0;
    font-size: 14px;
}

.link:hover {
    text-decoration: underline;
}

.alert {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* OTP Step Styles */
.otp-step {
    display: none;
}

.otp-step.active {
    display: block;
}

.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 8px;
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    transition: background 0.3s;
}

.step-dot.active {
    background: #667eea;
}

.step-dot.completed {
    background: #28a745;
}

.otp-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.otp-input-group input {
    flex: 1;
}

.otp-timer {
    text-align: center;
    font-size: 13px;
    color: #666;
    margin-top: 10px;
}

.otp-timer strong {
    color: #667eea;
}

.otp-debug {
    background: #f8f9fa;
    border: 1px dashed #6c757d;
    border-radius: 5px;
    padding: 10px;
    margin-top: 15px;
    font-size: 13px;
    text-align: center;
    color: #6c757d;
}

.otp-debug strong {
    color: #28a745;
    font-size: 18px;
    letter-spacing: 3px;
}

/* Tab Navigation for Auth */
.auth-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 25px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    color: #666;
    font-weight: 500;
    font-size: 14px;
    border: none;
    background: none;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.auth-tab:hover {
    color: #667eea;
}

.auth-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form Row for side-by-side fields */
.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* Section Header */
.section-header {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

/* Back Button */
.back-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 0;
    margin-bottom: 15px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.back-btn:hover {
    text-decoration: underline;
}

.test-info {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    padding: 15px;
    margin-top: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.test-info h3 {
    color: #856404;
    margin-bottom: 10px;
    font-size: 16px;
}

.test-info ul {
    list-style: none;
    padding: 0;
}

.test-info li {
    padding: 5px 0;
    color: #856404;
    font-size: 14px;
}

/* ============================================================
   DASHBOARD STYLES - MODERN & CLEAN
   ============================================================ */
.dashboard-body {
    background: #f0f2f5;
    display: block;
    min-height: 100vh;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
    background: #f0f2f5;
}

/* ---- Sidebar ---- */
.sidebar {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    width: 260px;
    min-width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-header .brand-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 3px;
    color: #fff;
}

.sidebar-header p {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 5px;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 13px 24px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
    gap: 12px;
    border-left: 3px solid transparent;
    margin: 2px 0;
}

.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.sidebar-menu li a.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-left-color: #667eea;
}

.sidebar-menu li a .menu-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    overflow-y: auto;
    background: #f0f2f5;
}

/* ---- Top Header Bar ---- */
.content-header {
    background: white;
    padding: 18px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 99;
}

.content-header h2 {
    font-size: 22px;
    color: #1a1a2e;
    font-weight: 700;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info .user-phone {
    color: #666;
    font-size: 14px;
    background: #f8f9fa;
    padding: 6px 14px;
    border-radius: 20px;
}

.user-info .user-shop {
    font-weight: 600;
    color: #333;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-logout:hover {
    background: #fecaca;
    transform: translateY(-1px);
}

/* ---- Content Body ---- */
.content-body {
    padding: 25px 30px;
}

/* ---- Stats Grid ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 13px;
    color: #4a5568;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.3px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
    word-break: break-all;
}

.stat-card .stat-label {
    font-size: 12px;
    color: #888;
    margin-top: auto;
}

/* ---- Cards ---- */
.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #eee;
}

.card h2 {
    font-size: 18px;
    color: #1a1a2e;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f2f5;
}

.card h3 {
    font-size: 15px;
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
}

/* ---- Quick Action Buttons ---- */
.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.action-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.action-btn-success {
    background: #10b981;
    color: white;
}

.action-btn-info {
    background: #3b82f6;
    color: white;
}

.action-btn-warning {
    background: #f59e0b;
    color: white;
}

.action-btn-danger {
    background: #ef4444;
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ---- Tables ---- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    background: #f8fafc;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f2f5;
    color: #334155;
}

tr:hover td {
    background: #f8fafc;
}

tr:last-child td {
    border-bottom: none;
}

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fce4ec;
    color: #c62828;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ---- Filter Bar ---- */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
    width: auto;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: white;
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: #667eea;
}

/* ---- No Data ---- */
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 14px;
}

.no-data-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* ---- Form Grid ---- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ---- Info Box ---- */
.info-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.info-box p {
    font-size: 13px;
    color: #475569;
    margin-bottom: 4px;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.info-box strong {
    color: #1a1a2e;
}

/* ---- Page Header ---- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 22px;
    color: #1a1a2e;
    font-weight: 700;
    border: none;
    padding: 0;
    margin: 0;
}

/* ---- Mobile Toggle ---- */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: #333;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* ---- Responsive ---- */
@media (max-width: 992px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        transition: left 0.3s;
        z-index: 100;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    /* Table action buttons - stack on mobile */
    .table-responsive td form,
    .table-responsive td a.btn-sm {
        display: block;
        width: 100%;
        margin: 3px 0;
    }
    
    .table-responsive .btn-sm {
        width: 100%;
        text-align: center;
        padding: 8px 10px;
        font-size: 12px;
    }
    
    td form input[type="hidden"] {
        display: none;
    }
    
    .content-header {
        padding: 12px 16px;
    }
    
    .content-header h2 {
        font-size: 18px;
    }
    
    .content-body {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card .stat-value {
        font-size: 22px;
    }
    
    .card {
        padding: 16px;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar input,
    .filter-bar select {
        min-width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .user-info .user-phone {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-box {
        padding: 15px;
    }
    
    .container {
        padding: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}