/* ===============================
   GLOBAL STYLES
=============================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #333;
}

/* ===============================
   LOGIN PAGE
=============================== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a237e, #0d47a1);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 420px;
}

.login-box h1 {
    text-align: center;
    color: #1a237e;
    margin-bottom: 10px;
    font-size: 28px;
}

.login-box p {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

/* ===============================
   FORM STYLES
=============================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #444;
}

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

.form-group input:focus,
.form-group select:focus {
    border-color: #1a237e;
}

/* ===============================
   BUTTONS
=============================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: #1a237e;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #0d47a1;
    transform: translateY(-2px);
}

.btn-success {
    background: #2e7d32;
    color: white;
}

.btn-success:hover { background: #1b5e20; }

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

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

.btn-warning {
    background: #f57f17;
    color: white;
}

.btn-warning:hover { background: #e65100; }

.btn-info {
    background: #0277bd;
    color: white;
}

.btn-info:hover { background: #01579b; }

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

/* ===============================
   NAVBAR
=============================== */
.navbar {
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.navbar h2 {
    font-size: 22px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar span {
    font-size: 14px;
    opacity: 0.9;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* ===============================
   SIDEBAR
=============================== */
.layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 240px;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    padding: 20px 0;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: #555;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar a:hover,
.sidebar a.active {
    background: #e8eaf6;
    color: #1a237e;
    border-left-color: #1a237e;
    font-weight: 600;
}

.sidebar a span {
    font-size: 18px;
}

/* ===============================
   MAIN CONTENT
=============================== */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    text-align: center;
    border-top: 4px solid;
}

.stat-card.blue { border-top-color: #1a237e; }
.stat-card.green { border-top-color: #2e7d32; }
.stat-card.orange { border-top-color: #e65100; }
.stat-card.red { border-top-color: #c62828; }

.stat-card .number {
    font-size: 40px;
    font-weight: bold;
    color: #1a237e;
}

.stat-card .label {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

.stat-card .icon {
    font-size: 30px;
    margin-bottom: 10px;
}

/* ===============================
   TABLE
=============================== */
.table-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

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

.table-header h3 {
    color: #1a237e;
    font-size: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #e8eaf6;
}

th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #1a237e;
    font-size: 13px;
    text-transform: uppercase;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

tr:hover {
    background: #f8f9ff;
}

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

.modal.show {
    display: flex;
}

.modal-box {
    background: white;
    border-radius: 15px;
    padding: 30px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

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

.modal-header h3 {
    color: #1a237e;
    font-size: 20px;
}

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

/* ===============================
   SEARCH BAR
=============================== */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.search-bar input:focus {
    border-color: #1a237e;
}

/* ===============================
   STATUS BADGES
=============================== */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-danger  { background: #ffebee; color: #c62828; }
.badge-warning { background: #fff3e0; color: #e65100; }
.badge-info    { background: #e3f2fd; color: #0277bd; }

/* ===============================
   ALERTS
=============================== */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.alert.show { display: block; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.alert-danger  { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.alert-info    { background: #e3f2fd; color: #0277bd; border: 1px solid #90caf9; }

/* ===============================
   PAGE TITLE
=============================== */
.page-title {
    font-size: 24px;
    color: #1a237e;
    margin-bottom: 25px;
    font-weight: 700;
}

/* ===============================
   RESPONSIVE
=============================== */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}