/* ============================================
   RESPONSIVE MODERN THEME
   ============================================ */

:root {
    --primary-color: #1a1a1a;
    --secondary-color: #333333;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #f5f5f5;
    --border-color: #e0e0e0;
    --text-dark: #1a1a1a;
    --text-light: #666666;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    color: var(--text-dark);
    background: var(--light-bg);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    line-height: 1.6;
    color: var(--text-light);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2a2a2a 0%, #444444 100%);
}

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

.btn-secondary:hover {
    background: #2980b9;
}

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

.btn-success:hover {
    background: #229954;
}

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

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

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(44, 62, 80, 0.1);
}

.form-control::placeholder {
    color: #bdc3c7;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

select.form-control {
    cursor: pointer;
}

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e0e0e0;
    border-left: none;
}

.navbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    text-decoration: none;
    transition: var(--transition);
    flex: 0 0 auto;
}

.navbar-brand:hover {
    color: #333333;
}

.navbar-brand img {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

.navbar-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.navbar-brand-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
    white-space: normal;
    max-width: 200px;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.navbar-item {
    position: relative;
}

.navbar-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-link:hover {
    color: #333333;
}

.navbar-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-search input {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    min-width: 200px;
    background: #f5f5f5;
    color: var(--text-dark);
}

.navbar-search input:focus {
    outline: none;
    border-color: #1a1a1a;
    background: white;
}

/* Mobile menu toggle */
.navbar-toggle {
    display: none !important;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
    padding: 0.5rem;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 70px;
    width: 250px;
    height: calc(100vh - 70px);
    background: #2a2a2a;
    overflow-y: auto;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.sidebar-header {
    display: none;
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 100%;
    text-align: right;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.sidebar-overlay.active {
    display: block;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-item {
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #999999;
    color: #ffffff;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #999999;
    color: #ffffff;
}

.sidebar-menu i {
    width: 24px;
    text-align: center;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main {
    margin-top: 70px;
    margin-left: 250px;
    padding: 2rem;
    min-height: calc(100vh - 70px);
}

.main-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #7f8c8d;
    font-size: 0.95rem;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

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

.card-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
    color: white;
    padding: 1.5rem;
    border-bottom: none;
}

.card-header h3 {
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: var(--light-bg);
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   TABLES
   ============================================ */

.table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.table thead {
    background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
    color: white;
}

.table thead th {
    padding: 1rem;
    font-weight: 600;
    text-align: left;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.table tbody td {
    padding: 1rem;
    color: var(--text-dark);
}

.table-striped tbody tr:nth-child(odd) {
    background: var(--light-bg);
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

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

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: white;
}

.badge-info {
    background: var(--secondary-color);
    color: white;
}

/* ============================================
   GRID LAYOUT
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.row.row-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.row.row-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.row.row-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.col {
    display: flex;
    flex-direction: column;
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

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

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .navbar-toggle {
        display: block !important;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 250px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-header {
        display: block !important;
    }

    .sidebar-overlay.active {
        display: block !important;
    }

    .main {
        margin-left: 0;
        margin-top: 70px;
    }

    .row {
        grid-template-columns: 1fr;
    }

    .table {
        font-size: 0.875rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.75rem 0.5rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .card-body {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1rem; }

    .navbar-container {
        padding: 0 0.75rem;
    }

    .navbar-brand {
        font-size: 0.85rem;
        gap: 0.5rem;
    }

    .navbar-brand img {
        height: 30px;
    }

    .navbar-brand-name {
        font-size: 0.75rem;
        max-width: 120px;
    }

    .table {
        font-size: 0.75rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.5rem 0.25rem;
    }

    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .form-control {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-slideUp {
    animation: slideUp 0.5s ease-out;
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-out;
}
