/*!
 * DarkFlow CSS Framework v1.0
 * A modern, dark-themed CSS framework inspired by system design
 * License: MIT
 */

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

/* ==================== CSS VARIABLES ==================== */
:root {
    /* Primary Colors */
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    
    /* Status Colors */
    --success: #27ae60;
    --success-dark: #229954;
    --warning: #f39c12;
    --warning-dark: #e67e22;
    --danger: #e74c3c;
    --danger-dark: #c0392b;
    --info: #3498db;
    --info-dark: #2980b9;
    --disabled: #404050;
    
    /* Background Colors */
    --bg-dark: #0f0f23;
    --bg-card: #1a1a2e;
    --bg-light: #16213e;
    
    /* Text Colors */
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b0;
    --text-muted: #6a6a7a;
    
    /* Border & Shadows */
    --border: #2d2d44;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ==================== TYPOGRAPHY ==================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

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

p {
    margin-bottom: 1em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ==================== LAYOUT SYSTEM ==================== */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    transition: grid-template-columns var(--transition-normal);
}

.app-container.sidebar-collapsed {
    grid-template-columns: 60px 1fr;
}

.main-content {
    padding: 30px;
    overflow-y: auto;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* ==================== GRID SYSTEM ==================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col {
    flex: 1;
    padding: 0 10px;
}

.col-1 { flex: 0 0 8.333%; max-width: 8.333%; padding: 0 10px; }
.col-2 { flex: 0 0 16.666%; max-width: 16.666%; padding: 0 10px; }
.col-3 { flex: 0 0 25%; max-width: 25%; padding: 0 10px; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 10px; }
.col-5 { flex: 0 0 41.666%; max-width: 41.666%; padding: 0 10px; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding: 0 10px; }
.col-7 { flex: 0 0 58.333%; max-width: 58.333%; padding: 0 10px; }
.col-8 { flex: 0 0 66.666%; max-width: 66.666%; padding: 0 10px; }
.col-9 { flex: 0 0 75%; max-width: 75%; padding: 0 10px; }
.col-10 { flex: 0 0 83.333%; max-width: 83.333%; padding: 0 10px; }
.col-11 { flex: 0 0 91.666%; max-width: 91.666%; padding: 0 10px; }
.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 10px; }

/* ==================== SIDEBAR ==================== */
.sidebar {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-light) 100%);
    border-right: 1px solid var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    transition: all var(--transition-normal);
}

.sidebar.collapsed {
    padding: 20px 10px;
}

.sidebar.collapsed .sidebar-content {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 1;
    transition: opacity var(--transition-normal);
}

.sidebar-toggle {
    position: absolute;
    top: 20px;
    right: -15px;
    width: 30px;
    height: 30px;
    background: var(--primary);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all var(--transition-normal);
    color: white;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* ==================== NAVIGATION ==================== */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-item-icon {
    width: 20px;
    text-align: center;
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

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

/* Button Variants */
.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border);
}

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

.btn-success:hover:not(:disabled) {
    background: var(--success-dark);
}

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

.btn-warning:hover:not(:disabled) {
    background: var(--warning-dark);
}

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

.btn-danger:hover:not(:disabled) {
    background: var(--danger-dark);
}

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

.btn-info:hover:not(:disabled) {
    background: var(--info-dark);
}

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

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

/* Button Sizes */
.btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* Button Group */
.btn-group {
    display: inline-flex;
    gap: 8px;
}

/* ==================== CARDS ==================== */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.card-title {
    font-size: 1.3em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    color: var(--text-secondary);
}

.card-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-light);
    color: var(--text-primary);
    transition: border-color var(--transition-normal);
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Select Styling */
select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0b0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

/* Checkbox & Radio */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

/* ==================== TABLES ==================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

table th {
    background: var(--bg-light);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

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

table tr:last-child td {
    border-bottom: none;
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

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

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

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

.badge-secondary {
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* ==================== ALERTS ==================== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(39, 174, 96, 0.15);
    color: var(--success);
    border-color: var(--success);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.15);
    color: var(--warning);
    border-color: var(--warning);
}

.alert-danger {
    background: rgba(231, 76, 60, 0.15);
    color: var(--danger);
    border-color: var(--danger);
}

.alert-info {
    background: rgba(52, 152, 219, 0.15);
    color: var(--info);
    border-color: var(--info);
}

/* ==================== MODALS ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.show,
.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.modal-title {
    font-size: 1.5em;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

/* ==================== MESSAGES ==================== */
.message {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
    align-items: center;
    gap: 10px;
    animation: messageSlideIn 0.3s ease;
}

.message.show {
    display: flex;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message.success {
    background: rgba(39, 174, 96, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
}

.message.error {
    background: rgba(231, 76, 60, 0.15);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.message.warning {
    background: rgba(243, 156, 18, 0.15);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.message.info {
    background: rgba(52, 152, 219, 0.15);
    color: var(--info);
    border: 1px solid var(--info);
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab:hover {
    color: var(--text-primary);
    background: var(--bg-light);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==================== PROGRESS BAR ==================== */
.progress {
    width: 100%;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width var(--transition-normal);
}

.progress-bar.success {
    background: var(--success);
}

.progress-bar.warning {
    background: var(--warning);
}

.progress-bar.danger {
    background: var(--danger);
}

/* ==================== SEARCH BOX ==================== */
.search-container {
    position: relative;
}

.search-box {
    width: 100%;
    padding: 12px 40px 12px 15px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-normal);
}

.search-box:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* ==================== STATS CARD ==================== */
.stats-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    text-align: center;
}

.stats-value {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.stats-label {
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== UTILITIES ==================== */
/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

/* Flex */
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.justify-start { justify-content: flex-start !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.align-start { align-items: flex-start !important; }
.align-center { align-items: center !important; }
.align-end { align-items: flex-end !important; }
.gap-1 { gap: 0.5rem !important; }
.gap-2 { gap: 1rem !important; }
.gap-3 { gap: 1.5rem !important; }
.gap-4 { gap: 2rem !important; }

/* Text Alignment */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* Text Colors */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }

/* Background Colors */
.bg-primary { background: var(--primary) !important; }
.bg-success { background: var(--success) !important; }
.bg-warning { background: var(--warning) !important; }
.bg-danger { background: var(--danger) !important; }
.bg-info { background: var(--info) !important; }
.bg-dark { background: var(--bg-dark) !important; }
.bg-card { background: var(--bg-card) !important; }
.bg-light { background: var(--bg-light) !important; }

/* Spacing */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.5rem !important; }
.m-2 { margin: 1rem !important; }
.m-3 { margin: 1.5rem !important; }
.m-4 { margin: 2rem !important; }

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

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

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

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

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

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 0.5rem !important; }
.pt-2 { padding-top: 1rem !important; }
.pt-3 { padding-top: 1.5rem !important; }
.pt-4 { padding-top: 2rem !important; }

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

.pl-0 { padding-left: 0 !important; }
.pl-1 { padding-left: 0.5rem !important; }
.pl-2 { padding-left: 1rem !important; }
.pl-3 { padding-left: 1.5rem !important; }
.pl-4 { padding-left: 2rem !important; }

.pr-0 { padding-right: 0 !important; }
.pr-1 { padding-right: 0.5rem !important; }
.pr-2 { padding-right: 1rem !important; }
.pr-3 { padding-right: 1.5rem !important; }
.pr-4 { padding-right: 2rem !important; }

/* Border Radius */
.rounded { border-radius: 8px !important; }
.rounded-sm { border-radius: 4px !important; }
.rounded-lg { border-radius: 12px !important; }
.rounded-full { border-radius: 9999px !important; }

/* Width */
.w-25 { width: 25% !important; }
.w-50 { width: 50% !important; }
.w-75 { width: 75% !important; }
.w-100 { width: 100% !important; }

/* Shadow */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    opacity: 0;
    transform: translateX(100%);
    transition: all var(--transition-normal);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toast-icon {
    font-size: 1.2em;
}

.toast-message {
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.toast-close:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-error .toast-icon {
    color: var(--danger);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-warning .toast-icon {
    color: var(--warning);
}

.toast-info {
    border-left: 4px solid var(--info);
}

.toast-info .toast-icon {
    color: var(--info);
}

/* ==================== DROPDOWN MENU ==================== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 1000;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.dropdown-item.active {
    background: var(--primary);
    color: white;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 5px 0;
}

/* ==================== TOOLTIP ==================== */
.tooltip-box {
    position: absolute;
    background: var(--bg-dark);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    white-space: nowrap;
}

.tooltip-box.show {
    opacity: 1;
}

.tooltip-box::before {
    content: '';
    position: absolute;
    border: 5px solid transparent;
}

.tooltip-box.tooltip-top::before {
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: var(--border);
}

.tooltip-box.tooltip-bottom::before {
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: var(--border);
}

.tooltip-box.tooltip-left::before {
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: var(--border);
}

.tooltip-box.tooltip-right::before {
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: var(--border);
}

/* ==================== ACCORDION ==================== */
.accordion {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid var(--border);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    padding: 15px 20px;
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-fast);
    color: var(--text-primary);
    font-weight: 500;
}

.accordion-header:hover {
    background: var(--bg-light);
}

.accordion-header.active {
    background: var(--bg-light);
    color: var(--primary);
}

.accordion-icon {
    transition: transform var(--transition-fast);
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

.accordion-content.show {
    max-height: 1000px;
}

.accordion-body {
    padding: 20px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
}

/* ==================== ALERT WITH CLOSE ==================== */
.alert {
    position: relative;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.alert-close:hover {
    opacity: 1;
}

/* ==================== FORM VALIDATION ==================== */
input.invalid,
textarea.invalid,
select.invalid {
    border-color: var(--danger);
}

.field-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 5px;
}

/* ==================== LOADING SPINNER ==================== */
.spinner {
    border: 3px solid var(--bg-light);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-large {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 100;
        transition: left var(--transition-normal);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .toast-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }

    .dropdown-menu {
        left: auto;
        right: 0;
    }
}
