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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
    font-size: 14px;
}

/* NAVBAR */
.navbar {
    background: #1a3a5c;
    color: white;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand { font-size: 18px; font-weight: 700; }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    transition: background 0.2s;
}
.nav-links a:hover { background: rgba(255,255,255,0.15); color: white; }
.btn-logout {
    background: #e74c3c !important;
    color: white !important;
    padding: 6px 14px;
    border-radius: 6px;
}

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

/* PAGE HEADER */
.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.page-header h1 { font-size: 24px; color: #1a3a5c; }
.date-badge, .badge-count {
    background: #e8f0fe;
    color: #1a3a5c;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* STATS GRID */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid;
}
.stat-card.today { border-color: #3498db; }
.stat-card.week { border-color: #2ecc71; }
.stat-card.month { border-color: #9b59b6; }
.stat-card.workers { border-color: #e67e22; }
.stat-icon { font-size: 32px; }
.stat-value { font-size: 20px; font-weight: 700; color: #1a3a5c; }
.stat-label { color: #666; font-size: 13px; }
.stat-sub { color: #999; font-size: 12px; margin-top: 2px; }

/* STATS MINI */
.stats-mini-grid { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.mini-stat {
    background: white;
    border-radius: 10px;
    padding: 16px 24px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    min-width: 140px;
}
.mini-val { font-size: 18px; font-weight: 700; color: #1a3a5c; }
.mini-label { color: #666; font-size: 12px; margin-top: 4px; }

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.1s;
}
.btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: #3498db; color: white; }
.btn-success { background: #2ecc71; color: white; }
.btn-warning { background: #f39c12; color: white; }
.btn-danger { background: #e74c3c; color: white; }
.btn-info { background: #17a2b8; color: white; }
.btn-secondary { background: #6c757d; color: white; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; text-align: center; padding: 12px; }

/* QUICK LINKS */
.quick-links { display: flex; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }

/* SECTION */
.section { background: white; border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.section h2 { font-size: 16px; color: #1a3a5c; margin-bottom: 16px; }

/* TABLE */
.table { width: 100%; border-collapse: collapse; }
.table th { background: #f8f9fa; color: #555; font-weight: 600; padding: 10px 12px; text-align: left; border-bottom: 2px solid #e9ecef; font-size: 13px; }
.table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
.table tr:hover td { background: #f8f9fa; }
.table-sm th, .table-sm td { padding: 7px 10px; }
.money { font-weight: 600; color: #1a3a5c; text-align: right; }
.text-center { text-align: center; color: #999; }
.text-muted { color: #999; font-size: 13px; }
.total-row td { background: #e8f0fe !important; font-weight: 700; }

/* BADGE */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-qoplovchi { background: #e3f2fd; color: #1565c0; }
.badge-ramkachi { background: #fff3e0; color: #e65100; }
.badge-tikuvchi { background: #f3e5f5; color: #6a1b9a; }

/* FILTER FORM */
.filter-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filter-form input[type="date"] { padding: 7px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.filter-form label { color: #555; font-weight: 500; }

/* INLINE FORM */
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; min-width: 180px; }

/* WORKER INFO CARD */
.worker-info-card { background: white; border-radius: 12px; padding: 16px 20px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); display: flex; gap: 24px; flex-wrap: wrap; }
.info-item { display: flex; gap: 8px; align-items: center; color: #555; }

/* DIVAN CARD */
.divan-card { background: white; border-radius: 12px; padding: 20px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.divan-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.divan-header h3 { color: #1a3a5c; font-size: 16px; }
.divan-header small { color: #999; font-size: 13px; }
.work-types-section h4 { color: #555; margin-bottom: 10px; font-size: 14px; }

.add-wt-details { margin-top: 12px; }
.add-wt-details summary { cursor: pointer; }
.add-wt-form { margin-top: 10px; padding: 12px; background: #f8f9fa; border-radius: 8px; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-row input, .form-row select { padding: 7px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.form-row input[type="number"] { width: 140px; }
.form-row input[type="text"] { min-width: 160px; }

.price-update-form { display: flex; gap: 6px; align-items: center; }
.price-update-form input { width: 110px; padding: 5px 8px; border: 1px solid #ddd; border-radius: 5px; font-size: 12px; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 40px; color: #999; background: white; border-radius: 12px; }

/* INVITE BOX */
.invite-box { background: #e8f4fd; border: 1px solid #b3d9f5; border-radius: 10px; padding: 14px 18px; margin-bottom: 20px; font-size: 14px; }
.invite-box code { background: #fff; padding: 3px 8px; border-radius: 4px; font-size: 13px; user-select: all; }

/* EXTRA BADGES */
.badge-active   { background: #d4edda; color: #155724; }
.badge-inactive { background: #f8d7da; color: #721c24; }
.link { color: #3498db; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* LOGIN PAGE */
body.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1a3a5c, #2e75b6); }
.login-box { background: white; border-radius: 16px; padding: 40px; width: 360px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.login-logo { font-size: 48px; text-align: center; margin-bottom: 8px; }
.login-box h2 { text-align: center; color: #1a3a5c; margin-bottom: 28px; font-size: 18px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; color: #555; margin-bottom: 6px; font-weight: 500; font-size: 13px; }
.form-group input { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; transition: border-color 0.2s; }
.form-group input:focus { outline: none; border-color: #3498db; }

/* ALERT */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert-error { background: #fdecea; color: #c0392b; border: 1px solid #f5b7b1; }
