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

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

body {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
}

.container {
    width: 100%;
    padding: 15px;
}

/* ===== LAYOUT ===== */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 15px;
    text-align: center;
    border-radius: 0 0 15px 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.header p {
    font-size: 12px;
    opacity: 0.9;
}

.content {
    padding: 15px;
    background: #fff;
    border-radius: 10px;
}

/* ===== LOGIN ===== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
}

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

.login-box .subtitle {
    color: #666;
    margin-bottom: 25px;
    font-size: 14px;
}

.info-text {
    background: #f0f0f0;
    padding: 10px;
    border-radius: 8px;
    text-align: left;
    line-height: 1.6;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 15px;
    text-align: left;
}

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

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

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

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

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #ddd;
}

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

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

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

.btn-success {
    background: #51cf66;
    color: white;
}

.btn-success:hover {
    background: #40c057;
}

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

.btn-small {
    padding: 8px 12px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-group .btn {
    flex: 1;
}

/* ===== ALERTS ===== */
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
}

.alert-error {
    background: #ffe0e0;
    border: 1px solid #ff6b6b;
    color: #c92a2a;
}

.alert-success {
    background: #e7f5e7;
    border: 1px solid #51cf66;
    color: #2f9e44;
}

.alert-info {
    background: #e7f5ff;
    border: 1px solid #4dabf7;
    color: #1864ab;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.card-header {
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.card-text {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.card-value {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
}

/* ===== TABLES ===== */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 15px;
}

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

.table thead {
    background: #f5f5f5;
    font-weight: 600;
}

.table th {
    padding: 10px;
    text-align: left;
    border-bottom: 2px solid #ddd;
}

.table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.table tbody tr:hover {
    background: #f9f9f9;
}

.table-actions {
    display: flex;
    gap: 5px;
}

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.stat-box.secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-box.success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-box.warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
}

/* ===== NAVIGATION ===== */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-radius: 10px;
}

.navbar h2 {
    font-size: 18px;
    margin: 0;
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    font-size: 12px;
    transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,0.4);
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: white;
    color: #666;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-size: 12px;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #667eea;
    color: white;
    border-bottom: 3px solid #667eea;
}

.tab-content {
    display: none;
}

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

/* ===== BADGE ===== */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: #51cf66;
    color: white;
}

.badge-danger {
    background: #ff6b6b;
    color: white;
}

.badge-warning {
    background: #ffd43b;
    color: #333;
}

.badge-info {
    background: #4dabf7;
    color: white;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}

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

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

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

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* ===== LOADING ===== */
.loading {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    border: 4px solid #f0f0f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    .table {
        font-size: 11px;
    }
    
    .table th,
    .table td {
        padding: 8px 5px;
    }
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 15px;
    color: #666;
    font-size: 12px;
    margin-top: 20px;
    border-top: 1px solid #eee;
}

/* ===== UTILITY ===== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-10 {
    padding: 10px;
}

.p-20 {
    padding: 20px;
}

.hidden {
    display: none;
}

.flex {
    display: flex;
    gap: 10px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
