* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
}
.container { max-width: 1300px; margin: 0 auto; padding: 0 20px; }

/* Header */
header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
}
header h1 { display: inline-block; font-size: 22px; }
header nav { display: inline-block; margin-right: 30px; }
header nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    margin: 0 12px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}
header nav a:hover, header nav a.active { background: rgba(255,255,255,0.15); color: white; }

.alert-badge {
    position: absolute;
    top: 15px;
    left: 20px;
    background: #e74c3c;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(231,76,60,0.4);
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

main { padding: 30px 0; }
h2 { margin: 25px 0 15px; color: #34495e; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-right: 4px solid #3498db;
}
.stat-card.stat-warning { border-color: #e74c3c; }
.stat-card.stat-good { border-color: #27ae60; }
.stat-card .num { font-size: 36px; font-weight: bold; color: #2c3e50; }
.stat-card .label { color: #7f8c8d; font-size: 14px; margin-top: 5px; }

/* Tables */
table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-collapse: collapse;
    margin-bottom: 20px;
}
th, td { padding: 12px 15px; text-align: right; border-bottom: 1px solid #ecf0f1; }
th { background: #34495e; color: white; font-weight: 600; }
tr:hover { background: #f8f9fa; }
.row-overdue { background: #fff5f5; }
.row-overdue:hover { background: #ffe8e8; }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    background: #95a5a6;
    color: white;
}
.badge-vip { background: #e74c3c; }
.badge-high { background: #e67e22; }
.badge-normal { background: #3498db; }
.badge-low { background: #95a5a6; }
.badge-good { background: #27ae60; }
.badge-ignore { background: #7f8c8d; }

/* Priority row tints */
.priority-vip { border-right: 3px solid #e74c3c; }
.priority-high { border-right: 3px solid #e67e22; }

/* Forms */
.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.card summary { cursor: pointer; padding: 5px 0; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 15px;
}
.form-grid label { display: block; font-size: 13px; color: #555; }
.form-grid input, .form-grid select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    margin-top: 4px;
}
.form-grid button, button:not(.btn-sm) {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}
.form-grid button:hover, button:hover { background: #2980b9; }

.btn-sm {
    background: #ecf0f1;
    color: #2c3e50;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin: 2px;
}
.btn-sm:hover { background: #bdc3c7; }
.btn-danger { background: #e74c3c; color: white; }
.btn-danger:hover { background: #c0392b; }

/* Messages */
.success, .error {
    padding: 12px 18px;
    border-radius: 6px;
    margin: 15px 0;
}
.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.empty {
    background: white;
    padding: 30px;
    text-align: center;
    color: #7f8c8d;
    border-radius: 8px;
}

/* Login */
.login-bg {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 380px;
}
.login-box h1 { text-align: center; color: #2c3e50; margin-bottom: 5px; }
.login-box h2 { text-align: center; color: #7f8c8d; font-weight: normal; margin-bottom: 25px; font-size: 16px; }
.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}
.login-box button { width: 100%; padding: 12px; }

/* Toasts */
#toastContainer {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    max-width: 400px;
}
.toast {
    background: white;
    border-right: 5px solid #e74c3c;
    padding: 15px 20px;
    margin-top: 10px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
    cursor: pointer;
}
.toast.dismiss { animation: slideOut 0.3s ease forwards; }
@keyframes slideIn { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-100%); opacity: 0; } }
.toast strong { color: #e74c3c; display: block; margin-bottom: 5px; }
.toast small { color: #7f8c8d; }

code { background: #f0f3f5; padding: 2px 6px; border-radius: 3px; font-size: 13px; color: #c0392b; }
