/* ACE Management System - Optimized Styles */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    /* Colors */
    --primary: #0078d4;
    --primary-hover: #005a9e;
    --secondary: #6c757d;
    --success: #107c10;
    --danger: #d13438;
    --warning: #f7630c;
    --info: #0099bc;
    
    /* Backgrounds */
    --bg-body: #f3f3f3;
    --bg-card: #ffffff;
    --bg-hover: #f8f9fa;
    
    /* Borders */
    --border-color: #e5e5e5;
    --border-radius: 8px;
    
    /* Text */
    --text-primary: #1f1f1f;
    --text-secondary: #605e5c;
    --text-muted: #999;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    
    /* Transitions */
    --transition: all 0.2s ease;
}

/* ========================================
   BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn i {
    font-size: 16px;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 13px;
}

.btn-sm i {
    font-size: 14px;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 16px;
}

/* Button Colors */
.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--secondary);
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
    color: #fff;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #0c6a0c;
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b02a2e;
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-warning:hover {
    background: #d55a09;
    color: #fff;
}

.btn-info {
    background: var(--info);
    color: #fff;
}

.btn-info:hover {
    background: #007a99;
    color: #fff;
}

/* Outline Buttons */
.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

.btn-outline-warning {
    background: transparent;
    color: var(--warning);
    border: 1px solid var(--warning);
}

.btn-outline-warning:hover {
    background: var(--warning);
    color: #fff;
}

/* ========================================
   TABLES
   ======================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    background: var(--bg-hover);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.table-hover tbody tr:hover {
    background: var(--bg-hover);
}

.table-sm th,
.table-sm td {
    padding: 0.5rem;
}

.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    background: var(--border-color);
}

/* ========================================
   FORMS
   ======================================== */
.form-control,
.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,120,212,0.1);
}

.form-control-sm {
    padding: 0.375rem 0.5rem;
    font-size: 13px;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 13px;
}

.readonly-section input,
.readonly-section select,
.readonly-section textarea {
    background: var(--bg-hover);
    cursor: not-allowed;
}

/* ========================================
   SIDEBAR
   ======================================== */
#sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    margin: 0.25rem 0.5rem;
}

.nav-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary);
    color: #fff;
}

/* ========================================
   BADGES & ALERTS
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
}

.badge i {
    font-size: 14px;
    margin-right: 0.25rem;
}

.bg-success {
    background: var(--success);
    color: #fff;
}

.bg-warning {
    background: var(--warning);
    color: #fff;
}

.bg-info {
    background: var(--info);
    color: #fff;
}

.bg-secondary {
    background: var(--secondary);
    color: #fff;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========================================
   UTILITIES
   ======================================== */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }

.fw-bold { font-weight: 600 !important; }
.text-end { text-align: right !important; }
.text-center { text-align: center !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }

.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }

.me-2 { margin-right: 0.5rem !important; }

.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        font-size: 13px;
        padding: 0.5rem 0.875rem;
    }
    
    .table {
        font-size: 13px;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: #fff;
    }
    
    .card {
        box-shadow: none;
        border: none;
    }
}
