/* RESET */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: #f1f5f9;
    color: #0f172a;
}

/* LAYOUT */
.container {
    width: 100%;
    max-width: 1100px;
    margin: auto;
    padding: 16px;
}

/* NAVBAR */
.navbar {
    background: #0f172a;
    color: #fff;
    padding: 12px 16px;
}

.navbar h1 {
    font-size: 18px;
}

/* CARD */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,.05);
    margin-bottom: 16px;
}

/* BUTTON */
.btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

.btn-primary { background: #2563eb; color:#fff; }
.btn-success { background: #16a34a; color:#fff; }
.btn-danger  { background: #dc2626; color:#fff; }
.btn-warning { background: #f59e0b; color:#fff; }

.btn:hover { opacity: .9 }

/* FORM */
.form-group {
    margin-bottom: 12px;
}

input, select {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #cbd5f5;
}

/* TABLE */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th, td {
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

th {
    background: #f8fafc;
}

/* ALERT */
.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.alert-success { background:#dcfce7;color:#166534 }
.alert-error   { background:#fee2e2;color:#991b1b }

/* MOBILE */
@media (max-width: 768px) {
    .navbar h1 {
        font-size: 16px;
    }
}

.admin-user {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 14px;
}

.logout-btn {
    background: #ef4444;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
}

.logout-btn:hover {
    background: #dc2626;
}

/* WELCOME */
.welcome-card p {
    margin-top: 6px;
    color: #475569;
}

/* STATS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 18px rgba(0,0,0,.05);
}

.stat-card h4 {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 8px;
}

.stat-card span {
    font-size: 24px;
    font-weight: bold;
    color: #0f172a;
}

/* MENU */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.menu-card {
    background: white;
    padding: 20px;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 10px 22px rgba(0,0,0,.06);
    transition: .2s;
}

.menu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(0,0,0,.08);
}

.menu-card .icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.menu-card h4 {
    margin-bottom: 6px;
}

.menu-card p {
    font-size: 14px;
    color: #64748b;
}


/* Responsive Table Styles */
.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
    border-radius: 8px;
}

.responsive-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    background: white;
}

.responsive-table thead {
    background-color: #f8fafc;
}

.responsive-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    font-size: 14px;
    white-space: nowrap;
}

.responsive-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.responsive-table tr:hover {
    background-color: #f8fafc;
}

.responsive-table tr:last-child td {
    border-bottom: none;
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    .container {
        padding: 12px;
        max-width: 100%;
    }
    
    .card {
        margin: 10px 0;
        padding: 20px 15px;
        border-radius: 12px;
    }
    
    .welcome-card h3 {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .welcome-card p {
        font-size: 14px;
        margin: 0;
    }
    
    .table-responsive-wrapper {
        margin: 15px -15px;
        width: calc(100% + 30px);
    }
    
    .responsive-table {
        min-width: 500px;
    }
    
    .responsive-table th,
    .responsive-table td {
        padding: 12px 10px;
        font-size: 13px;
    }
    
    /* Hide table headers on mobile and use data-label */
    @media screen and (max-width: 600px) {
        .responsive-table {
            min-width: 100%;
            display: block;
        }
        
        .responsive-table thead {
            display: none;
        }
        
        .responsive-table tbody {
            display: block;
        }
        
        .responsive-table tr {
            display: block;
            margin-bottom: 15px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 15px;
            background: white;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }
        
        .responsive-table td {
            display: block;
            padding: 10px 0;
            border-bottom: 1px solid #f1f5f9;
            text-align: left;
            position: relative;
            padding-left: 45%;
        }
        
        .responsive-table td:last-child {
            border-bottom: none;
            padding-top: 15px;
        }
        
        .responsive-table td:before {
            content: attr(data-label);
            position: absolute;
            left: 15px;
            width: 40%;
            padding-right: 10px;
            font-weight: 600;
            color: #475569;
            font-size: 13px;
        }
        
        .btn-block {
            display: inline-block;
            width: auto;
            min-width: 80px;
            text-align: center;
        }
    }
    
    /* Extra small screens */
    @media screen and (max-width: 400px) {
        .container {
            padding: 8px;
        }
        
        .card {
            padding: 15px 12px;
        }
        
        .responsive-table td {
            padding-left: 50%;
            font-size: 12px;
        }
        
        .responsive-table td:before {
            font-size: 12px;
            width: 45%;
        }
        
        .btn-sm {
            padding: 6px 12px;
            font-size: 12px;
        }
    }
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.btn-warning {
    background-color: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.2);
}

/* Container and Card Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.welcome-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.welcome-card h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.welcome-card p {
    margin: 0;
    opacity: 0.9;
}

h3 {
    margin: 0 0 20px 0;
    color: #1e293b;
    font-size: 18px;
}
