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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8fafc;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

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

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-weight: 600;
    font-size: 24px;
}

/* Accounting Page */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    font-size: 14px;
}

.tab-btn.active {
    border-bottom-color: #007bff;
    color: #007bff;
}

.tab-content {
    display: none;
}

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

.section {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.form-inline input, .form-inline select, .form-inline button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-inline button {
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.form-inline button:hover {
    background: #0056b3;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

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

.form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.form-group input, .form-group select, .form-group textarea {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    margin-right: 10px;
}

.form-group button:hover {
    background: #0056b3;
}

.form-group button[type="button"] {
    background: #6c757d;
}

.form-group button[type="button"]:hover {
    background: #545b62;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table th, .table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.table tr:hover {
    background: #f8f9fa;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-small:hover {
    background: #218838;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    border: 1px solid transparent;
}

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

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* 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);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

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

.close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

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

.section-header h3 {
    margin: 0;
}

/* Form Footer */
.form-footer {
    margin-top: 20px;
    text-align: center;
}

.forgot-password-link,
.back-to-login {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.forgot-password-link:hover,
.back-to-login:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Small text helper */
.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* ===== TABLET RESPONSIVE (769px - 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 95%;
        padding: 0 24px;
    }
    
    .login-container {
        max-width: 500px;
    }
    
    .login-box {
        padding: 40px;
        border-radius: 8px;
    }
    
    .login-box h2 {
        font-size: 24px;
        margin-bottom: 30px;
    }
    
    .form-group input, 
    .form-group select, 
    .form-group textarea {
        padding: 16px 18px;
        font-size: 14px;
        border-radius: 8px;
        min-height: 48px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .btn {
        padding: 14px 20px;
        font-size: 14px;
        min-height: 48px;
        border-radius: 8px;
    }
    
    .btn-sm, .btn-small {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 40px;
    }
    
    .forgot-password-link,
    .back-to-login {
        font-size: 14px;
        padding: 6px;
    }
    
    .nav {
        float: none;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 16px;
        gap: 8px;
    }
    
    .nav a {
        margin-left: 0;
        padding: 10px 14px;
        font-size: 13px;
        min-height: 40px;
        display: flex;
        align-items: center;
        border-radius: 8px;
        white-space: nowrap;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .stat-item {
        padding: 24px 20px;
    }
    
    .stat-number {
        font-size: 32px;
        margin-bottom: 8px;
    }
    
    .stat-label {
        font-size: 14px;
    }
    
    .content-section {
        margin-bottom: 32px;
    }
    
    .section-header {
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
    
    .data-table {
        border-radius: 8px;
    }
    
    .minimal-table th, .minimal-table td {
        padding: 14px 16px;
        font-size: 13px;
    }
    
    .minimal-table th {
        font-size: 12px;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    
    .modal-content {
        width: 90%;
        max-width: 500px;
    }
    
    .alert {
        padding: 16px 18px;
        font-size: 14px;
        border-radius: 8px;
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    /* Form grid tablet için */
    .form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    
    .form-inline {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .form-inline input,
    .form-inline select,
    .form-inline button {
        flex: 1;
        min-width: 120px;
    }
    
    /* Action buttons tablet */
    .action-buttons {
        flex-direction: row;
        gap: 8px;
    }
    
    .action-btn {
        flex: 1;
        min-width: 80px;
    }
    
    /* Search section tablet */
    .search-form {
        gap: 12px;
    }
    
    .search-form input[type="text"] {
        min-width: 250px;
    }
}

/* ===== LARGE TABLET/SMALL DESKTOP (1025px - 1200px) ===== */
@media (min-width: 1025px) and (max-width: 1200px) {
    .container {
        max-width: 1150px;
        padding: 0 30px;
    }
}

/* ===== DESKTOP (1201px+) ===== */
@media (min-width: 1201px) {
    .container {
        max-width: 1200px;
        padding: 0 40px;
    }
}

/* ===== MOBILE RESPONSIVE (320px - 768px) ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
        max-width: 100%;
    }
    
    .login-container {
        max-width: 100%;
        padding: 16px;
    }
    
    .login-box {
        padding: 24px 20px;
        border-radius: 8px;
        margin: 16px 0;
    }
    
    .login-box h2 {
        font-size: 20px;
        margin-bottom: 24px;
    }
    
    .form-group input, 
    .form-group select, 
    .form-group textarea {
        padding: 14px 16px;
        font-size: 16px; /* iOS zoom engellemek için */
        border-radius: 8px;
        min-height: 48px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
        font-weight: 500;
    }
    
    .btn {
        padding: 14px 18px;
        font-size: 14px;
        min-height: 48px;
        border-radius: 8px;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn-sm, .btn-small {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 40px;
        width: auto;
        margin-bottom: 6px;
    }
    
    .header {
        padding: 16px 0;
    }
    
    .header h1 {
        float: none !important;
        text-align: center;
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .nav {
        float: none !important;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        margin-top: 0;
    }
    
    .nav a {
        margin-left: 0;
        padding: 10px 6px;
        font-size: 12px;
        text-align: center;
        border-radius: 6px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-item {
        padding: 16px 12px;
    }
    
    .stat-number {
        font-size: 20px;
        margin-bottom: 4px;
    }
    
    /* Form grid mobile için */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .form-inline {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .form-inline input,
    .form-inline select,
    .form-inline button {
        width: 100%;
        margin-bottom: 8px;
    }
    
    /* Tablo responsive */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table th,
    .table td {
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .table th {
        font-size: 12px;
    }
    
    /* Modal responsive */
    .modal-content {
        margin: 20px auto;
        width: 95%;
        max-width: none;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    /* Action buttons mobile */
    .action-buttons {
        flex-direction: column;
        gap: 6px;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .content-section {
        margin-bottom: 24px;
    }
    
    .section-header {
        margin-bottom: 16px;
        padding-bottom: 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .section-header h2 {
        font-size: 16px;
    }
    
    .data-table {
        border-radius: 8px;
    }
    
    .minimal-table th, .minimal-table td {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .minimal-table th {
        font-size: 11px;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    
    .alert {
        padding: 12px;
        font-size: 13px;
        border-radius: 8px;
        margin-bottom: 16px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 10px auto;
        border-radius: 8px;
    }
    
    .forgot-password-link,
    .back-to-login {
        font-size: 14px;
        padding: 10px;
        display: block;
        text-align: center;
    }
}

/* ===== SMALL MOBILE (320px - 480px) ===== */
@media (max-width: 480px) {
    .nav {
        grid-template-columns: 1fr;
    }
    
    .nav a {
        font-size: 14px;
        padding: 14px 12px;
    }
    
    .login-box {
        padding: 24px 20px;
    }
    
    .stats-card {
        padding: 20px 16px;
    }
    
    .card {
        padding: 20px 16px;
    }
}

/* Touch Device Enhancements */
.is-mobile,
.is-tablet {
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Mobile keyboard handling */
.keyboard-open {
    height: 100vh;
    overflow: hidden;
}

.keyboard-open .container {
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Touch-friendly interactions */
.is-mobile .btn,
.is-tablet .btn,
.is-mobile .nav a,
.is-tablet .nav a {
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.is-mobile .btn:active,
.is-tablet .btn:active {
    transform: scale(0.98);
}

/* Enhanced touch targets */
@media (max-width: 1024px) {
    .btn, .nav a, .action-btn {
        min-height: 44px;
        min-width: 44px;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn:active, .nav a:active, .action-btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    /* Improve form inputs on touch */
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        transform: scale(1.02);
        transition: transform 0.2s ease;
    }
    
    /* Better table scrolling */
    .table-container {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .table-container::-webkit-scrollbar {
        height: 8px;
    }
    
    .table-container::-webkit-scrollbar-track {
        background: #f1f5f9;
    }
    
    .table-container::-webkit-scrollbar-thumb {
        background-color: #cbd5e0;
        border-radius: 4px;
    }
    
    /* Modal touch improvements */
    .modal-close {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Status badges touch-friendly */
    .status-badge, .plan-badge, .dealer-badge {
        padding: 6px 12px;
        min-height: 32px;
        display: inline-flex;
        align-items: center;
    }
}

/* Tablet landscape optimization */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .stat-item {
        padding: 20px 16px;
    }
    
    .stat-number {
        font-size: 28px;
    }
}

/* Tablet portrait optimization */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .nav {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .nav a {
        flex: 1;
        text-align: center;
        min-width: 100px;
    }
}

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

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

/* Compact modal form styling */
.modal .form-group {
    margin-bottom: 12px;
}

.modal .form-group label {
    margin-bottom: 4px;
    font-size: 13px;
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
    padding: 8px 12px;
    font-size: 13px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

/* Alerts */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

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

/* Layout */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: #fff;
    padding: 20px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    color: #1f2937;
    margin: 0;
    font-weight: 700;
    font-size: 24px;
}

.nav {
    float: right;
    margin-top: 5px;
}

.nav a {
    margin-left: 24px;
    color: #4b5563;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav a:hover {
    background: #f3f4f6;
    color: #3b82f6;
}

/* Tables */
.table {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.2);
}

.table th, .table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    font-size: 14px;
}

.table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.table tr {
    transition: all 0.3s ease;
}

.table tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
    transform: scale(1.01);
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.card h3 {
    margin-bottom: 20px;
    color: #1f2937;
    font-weight: 600;
    font-size: 18px;
}

/* Minimalist Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: box-shadow 0.2s ease;
}

.stat-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-number {
    font-size: 32px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Minimalist User Management Styles */
.user-management {
    background: #f8fafc;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.user-management .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.user-management h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 32px;
    text-align: center;
}

/* Search Section */
.search-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.search-section h2 {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 16px;
}

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #f9fafb;
    transition: all 0.2s ease;
    min-width: 300px;
}

.search-form input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-form .btn {
    padding: 6px 8px;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
    min-width: auto;
}

.search-form .btn-primary {
    background: #3b82f6;
    color: white;
}

.search-form .btn-primary:hover {
    background: #2563eb;
}

.search-form .btn-info {
    background: #6b7280;
    color: white;
}

.search-form .btn-info:hover {
    background: #4b5563;
}

/* Users Table Section */
.users-table-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.users-table-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
}

/* Modern Table Styles */
.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 0 1px #e5e7eb;
}

.modern-table th {
    background: #f8fafc;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e7eb;
}

.modern-table td {
    padding: 16px;
    color: #1f2937;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.modern-table tr:hover {
    background: #f9fafb;
}

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

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

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

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

/* Plan Badge */
.plan-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: #dbeafe;
    color: #1e40af;
}

.plan-badge.trial {
    background: #fef3c7;
    color: #92400e;
}

.plan-badge.no-plan {
    background: #f3f4f6;
    color: #6b7280;
}

/* Dealer Badge */
.dealer-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: #d1fae5;
    color: #065f46;
}

.dealer-badge.unassigned {
    background: #f3f4f6;
    color: #6b7280;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn.edit {
    background: #3b82f6;
    color: white;
}

.action-btn.edit:hover {
    background: #2563eb;
}

.action-btn.reset {
    background: #f59e0b;
    color: white;
}

.action-btn.reset:hover {
    background: #d97706;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 16px 0;
}

.pagination a,
.pagination strong {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    color: #6b7280;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.pagination strong {
    background: #3b82f6;
    color: white;
    font-weight: 500;
}

/* Modern Modal Styles */
.modern-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modern-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.modern-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modern-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modern-modal-body {
    padding: 24px;
}

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

/* Modern Form Styles */
.modern-form-group {
    margin-bottom: 20px;
}

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

.modern-form-group input,
.modern-form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.modern-form-group input:focus,
.modern-form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modern-form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modern-form-group.checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Modern Alert */
.modern-alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

.modern-alert.warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fed7aa;
}

/* User Info Helper */
.user-info {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 12px;
}

.user-info span {
    font-weight: 500;
    color: #374151;
}

/* Content Section */
.content-section {
    margin-bottom: 40px;
}

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

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

/* Minimal Table */
.data-table {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.minimal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.minimal-table th {
    background: #f9fafb;
    padding: 12px 16px;
    text-align: left;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.minimal-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    color: #1f2937;
}

.minimal-table tr:hover {
    background-color: #f9fafb;
}

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

/* Status indicators */
.status-active {
    color: #10b981;
    font-weight: 500;
}

.status-inactive {
    color: #ef4444;
    font-weight: 500;
}

/* Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -15px;
}

.col-md-6 {
    flex: 0 0 50%;
    padding: 15px;
}

.col-md-12 {
    flex: 0 0 100%;
    padding: 15px;
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: #3b82f6;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mobile-nav-toggle:hover {
    background: #f3f4f6;
}

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

.modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    width: 90%;
    max-width: 450px;
    max-height: 85vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: 16px;
}

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

/* Legacy modal support */
#editModal {
    backdrop-filter: blur(4px);
}

#editModal > div {
    background: #fff !important;
    border: 1px solid #e5e7eb;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15) !important;
    border-radius: 8px !important;
}

/* Success/Error Messages */
.success-box, .info-box {
    background: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1) !important;
}

/* Table Overflow for Mobile */
.table-container {
    overflow-x: auto;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

/* Visibility helpers */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
}

/* Small Mobile Phones */
@media (max-width: 420px) {
    .container {
        padding: 12px;
        max-width: 100%;
    }
    
    .header {
        padding: 12px 0;
        margin-bottom: 16px;
    }
    
    .header .container {
        padding: 0 12px;
    }
    
    .header h1 {
        font-size: 16px;
        margin-bottom: 10px;
        float: none !important;
        text-align: center;
    }
    
    .nav {
        float: none !important;
        margin-top: 10px;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
        width: 100%;
    }
    
    .nav a {
        margin: 0;
        padding: 8px 6px;
        background: #f3f4f6;
        border-radius: 6px;
        font-size: 11px;
        text-align: center;
        white-space: nowrap;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat-item {
        padding: 12px 10px;
    }
    
    .stat-number {
        font-size: 18px;
        margin-bottom: 4px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .content-section {
        margin-bottom: 20px;
    }
    
    .section-header {
        margin-bottom: 12px;
        padding-bottom: 8px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .section-header h2 {
        font-size: 14px;
    }
    
    .data-table {
        border-radius: 6px;
    }
    
    .minimal-table th, .minimal-table td {
        padding: 8px 10px;
        font-size: 11px;
    }
    
    .minimal-table th {
        font-size: 10px;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 6px;
    }
    
    .btn {
        padding: 10px 12px;
        font-size: 12px;
        border-radius: 6px;
        min-height: 40px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .form-group input, .form-group select, .form-group textarea {
        padding: 12px 14px;
        font-size: 14px;
        border-radius: 6px;
    }
    
    .alert {
        padding: 10px;
        font-size: 12px;
        border-radius: 6px;
    }
    
    .modal-content {
        width: 95%;
        max-width: 380px;
        margin: 10vh auto;
        border-radius: 8px;
    }
}

/* Medium Mobile Phones */
@media (min-width: 421px) and (max-width: 768px) {
    .container {
        padding: 16px;
        max-width: 100%;
    }
    
    .header {
        padding: 16px 0;
    }
    
    .header .container {
        padding: 0 16px;
    }
    
    .header h1 {
        font-size: 18px;
        margin-bottom: 12px;
        float: none !important;
        text-align: center;
    }
    
    .nav {
        float: none !important;
        margin-top: 12px;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 6px;
        width: 100%;
    }
    
    .nav a {
        margin: 0;
        padding: 10px 8px;
        background: #f3f4f6;
        border-radius: 6px;
        font-size: 12px;
        text-align: center;
        white-space: nowrap;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    
    .stat-item {
        padding: 20px 14px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .content-section {
        margin-bottom: 28px;
    }
    
    .section-header {
        margin-bottom: 18px;
        padding-bottom: 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .section-header h2 {
        font-size: 16px;
    }
    
    .data-table {
        border-radius: 8px;
    }
    
    .minimal-table th, .minimal-table td {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .minimal-table th {
        font-size: 11px;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 13px;
        border-radius: 8px;
        min-height: 44px;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group input, .form-group select, .form-group textarea {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .modal-content {
        width: 95%;
        max-width: 400px;
        margin: 7.5vh auto;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 20px 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-item {
        padding: 16px 12px;
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    .nav a {
        padding: 8px 10px;
        font-size: 11px;
    }
}