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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

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

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #667eea;
}

.login-box h2 {
    font-size: 18px;
    margin-bottom: 30px;
    color: #666;
}

/* Navigation */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 0.8;
}

.nav-user {
    color: #ecf0f1;
    font-size: 13px;
}

.btn-logout {
    background: #e74c3c;
    padding: 6px 12px;
    border-radius: 4px;
}

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

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    color: #2c3e50;
}

.page-header p {
    color: #7f8c8d;
    margin-top: 5px;
}

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

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

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

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

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

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

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

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

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 5px;
}

.stat-label {
    color: #7f8c8d;
    margin-bottom: 10px;
}

.stat-link {
    color: #3498db;
    text-decoration: none;
    font-size: 13px;
}

.stat-link:hover {
    text-decoration: underline;
}

/* Info Section */
.info-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-section h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.info-section ul {
    list-style: none;
}

.info-section li {
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
}

.info-section li:last-child {
    border-bottom: none;
}

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

.data-table thead {
    background: #34495e;
    color: white;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
}

.data-table tbody tr {
    border-bottom: 1px solid #ecf0f1;
}

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

/* Detail Table */
.detail-table {
    width: 100%;
    background: white;
}

.detail-table th {
    width: 200px;
    padding: 10px;
    text-align: left;
    background: #ecf0f1;
    font-weight: 600;
}

.detail-table td {
    padding: 10px;
}

.detail-table tr {
    border-bottom: 1px solid #ecf0f1;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-error {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-inactive {
    background: #e2e3e5;
    color: #6c757d;
}

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

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

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

.detail-section h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #2c3e50;
}

/* JSON Display */
.json-display {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

/* Hamburger Menu Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* ============================================
   RESPONSIVE DESIGN - MEDIA QUERIES
   ============================================ */

/* Tablet (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .container {
        padding: 20px 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .modal-content {
        width: 85%;
        padding: 25px;
    }
}

/* Mobile - Large (481px - 767px) */
@media screen and (max-width: 767px) {
    /* Navigation */
    .nav-container {
        padding: 12px 15px;
        position: relative;
    }
    
    .nav-brand {
        font-size: 16px;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #2c3e50;
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    
    .nav-links.active {
        max-height: 400px;
    }
    
    .nav-links a,
    .nav-links .nav-user {
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-links a:hover {
        background: rgba(255,255,255,0.1);
    }
    
    .btn-logout {
        margin: 10px 20px;
        text-align: center;
    }
    
    /* Container */
    .container {
        padding: 15px 10px;
    }
    
    /* Page Header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .page-header h1 {
        font-size: 22px;
    }
    
    .page-header .btn {
        width: 100%;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 18px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    /* Tables - Responsive Scroll */
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
    
    /* Make table scrollable on mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Detail Table */
    .detail-table th {
        width: 120px;
        font-size: 12px;
    }
    
    .detail-table td {
        font-size: 12px;
    }
    
    /* Forms */
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input,
    .form-group select {
        font-size: 13px;
        padding: 8px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 85vh;
    }
    
    .modal-content h2 {
        font-size: 18px;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* Login Box */
    .login-box {
        padding: 30px 20px;
        margin: 15px;
    }
    
    .login-box h1 {
        font-size: 20px;
    }
    
    .login-box h2 {
        font-size: 16px;
    }
    
    /* Info Section */
    .info-section {
        padding: 18px;
    }
    
    .info-section h2 {
        font-size: 16px;
    }
    
    /* Detail Section */
    .detail-section {
        padding: 15px;
    }
    
    .detail-section h2 {
        font-size: 16px;
    }
    
    /* JSON Display */
    .json-display {
        font-size: 11px;
        padding: 12px;
    }
}

/* Mobile - Small (320px - 480px) */
@media screen and (max-width: 480px) {
    body {
        font-size: 13px;
    }
    
    .nav-brand {
        font-size: 14px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .stat-number {
        font-size: 22px;
    }
    
    .stat-label {
        font-size: 13px;
    }
    
    .data-table {
        font-size: 11px;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }
    
    /* Stack action buttons vertically on very small screens */
    .data-table td form {
        display: block;
        margin: 3px 0;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .btn {
        font-size: 12px;
        padding: 8px 14px;
    }
    
    .form-group input,
    .form-group select {
        font-size: 12px;
    }
}

/* Landscape orientation adjustments */
@media screen and (max-width: 767px) and (orientation: landscape) {
    .nav-links.active {
        max-height: 250px;
        overflow-y: auto;
    }
    
    .modal-content {
        max-height: 80vh;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .form-actions,
    .nav-toggle {
        display: none;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .data-table {
        box-shadow: none;
    }
}
