/* Self Serve Admin Management UI Stylesheet */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f6f9;
    color: #333;
    min-height: 100vh;
}

/* ==================== Layout ==================== */

.layout {
    display: flex;
    min-height: 100vh;
}

#sidebar {
    width: 220px;
    background: #2c3e50;
    color: #fff;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 20px 16px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid #34495e;
}

#sidebar nav {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}

.nav-link {
    display: block;
    padding: 12px 16px;
    color: #bdc3c7;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
    background: #34495e;
    color: #fff;
}

.nav-link.active {
    background: #3498db;
    color: #fff;
}

.content {
    margin-left: 220px;
    flex: 1;
    padding: 24px;
    min-width: 0;
}

.page-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
}

/* ==================== Login Page ==================== */

.login-container {
    max-width: 380px;
    margin: 100px auto;
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 24px;
    color: #2c3e50;
    font-size: 22px;
}

/* ==================== Forms ==================== */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.15);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* ==================== Buttons ==================== */

.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn:hover {
    opacity: 0.85;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-success {
    background: #27ae60;
    color: #fff;
}

.btn-warning {
    background: #f39c12;
    color: #fff;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-full {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==================== Cards ==================== */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.card-label {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
}

/* ==================== Tables ==================== */

.table-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 280px;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
}

.table-wrap {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    text-align: left;
    padding: 10px 12px;
    background: #f8f9fa;
    color: #555;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
}

thead th.sortable {
    cursor: pointer;
    user-select: none;
}

thead th.sortable:hover {
    background: #e9ecef;
}

.sort-arrow {
    font-size: 11px;
    color: #3498db;
}

tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
}

tbody tr:nth-child(even) {
    background: #fafbfc;
}

tbody tr:hover {
    background: #eef5fc;
}

tbody tr.clickable {
    cursor: pointer;
}

/* ==================== Detail Panel ==================== */

.detail-panel {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.detail-panel h2 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #2c3e50;
}

/* ==================== Status Badges ==================== */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

/* ==================== Alerts ==================== */

.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.hidden {
    display: none !important;
}

/* ==================== Override Input ==================== */

.override-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.override-group input {
    width: 70px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

/* ==================== Responsive ==================== */

@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        width: 100%;
        height: auto;
        overflow-y: visible;
    }

    #sidebar nav {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0 8px 8px;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }

    .sidebar-header {
        padding: 12px 16px;
        font-size: 16px;
    }

    .content {
        margin-left: 0;
        margin-top: 120px;
        padding: 16px;
    }

    .search-input {
        width: 100%;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}
