/* ===== GLOBAL STYLES — FenixForge ===== */
:root {
    --primary:       #E65100;
    --primary-dark:  #BF360C;
    --primary-light: #FF6D00;
    --bg:            #ffffff;
    --bg-secondary:  #f5f5f5;
    --bg-card:       #ffffff;
    --text:          #212121;
    --text-secondary:#757575;
    --border:        #e0e0e0;
    --shadow:        0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover:  0 4px 16px rgba(0,0,0,0.15);
    --radius:        12px;
    --radius-sm:     8px;
    --transition:    0.3s ease;
    --header-height: 64px;
    --sidebar-width: 240px;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger:  #f44336;
    --info:    #2196F3;
}

[data-theme="dark"] {
    --bg:            #121212;
    --bg-secondary:  #1e1e1e;
    --bg-card:       #252525;
    --text:          #e0e0e0;
    --text-secondary:#aaaaaa;
    --border:        #333333;
    --shadow:        0 2px 8px rgba(0,0,0,0.4);
    --shadow-hover:  0 4px 16px rgba(0,0,0,0.5);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; font-size: inherit; }

input, textarea {
    font-family: inherit; font-size: inherit; outline: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    background: var(--bg); color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}
input:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230,81,0,0.15);
}
textarea { resize: vertical; min-height: 100px; }

select {
    font-family: inherit; font-size: 0.9rem; font-weight: 600;
    outline: none; appearance: none; -webkit-appearance: none;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 44px 12px 16px;
    background-color: var(--bg-card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath d='M1 1l6 7 6-7' stroke='%23E65100' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    color: var(--text); cursor: pointer;
    min-height: 46px;
    transition: all var(--transition);
    width: 100%;
}
select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(230,81,0,0.15); }

/* ===== HEADER ===== */
.header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: var(--shadow);
    transition: background var(--transition), border-color var(--transition);
}

.header-logo {
    display: flex; align-items: center; gap: 8px;
    font-size: 1.5rem; font-weight: 900;
    color: var(--primary); text-decoration: none; letter-spacing: -0.5px;
    flex-shrink: 0;
}
.header-logo:hover { color: var(--primary-dark); }
.header-logo span { font-size: 1.6rem; }

.header-controls { display: flex; align-items: center; gap: 8px; }

.header-theme-btn {
    height: 42px; border-radius: 22px;
    background: var(--bg-secondary); border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 0.85rem; font-weight: 700; cursor: pointer;
    transition: all var(--transition); color: var(--text);
    padding: 8px 14px;
}
.header-theme-btn:hover { border-color: var(--primary); }

.header-avatar-btn {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem; overflow: hidden;
    transition: all var(--transition); border: 2px solid transparent;
}
.header-avatar-btn:hover { border-color: var(--primary); }

.mobile-menu-btn {
    display: none; flex-direction: column; gap: 5px;
    background: transparent; padding: 8px; border-radius: var(--radius-sm);
}
.mobile-menu-btn span {
    display: block; width: 22px; height: 2px;
    background: var(--text); border-radius: 2px; transition: all var(--transition);
}

/* ===== DROPDOWN ===== */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); min-width: 200px;
    box-shadow: var(--shadow-hover); z-index: 100;
    display: none; overflow: hidden;
}
.dropdown-menu.open { display: block; }
.dropdown-user-info { padding: 14px 16px; }
.dropdown-username { font-weight: 700; font-size: 0.95rem; }
.dropdown-tag { color: var(--text-secondary); font-size: 0.8rem; }
.dropdown-divider { height: 1px; background: var(--border); }
.dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; font-size: 0.9rem;
    color: var(--text); transition: background var(--transition);
    width: 100%; background: none; text-align: left;
}
.dropdown-item:hover { background: var(--bg-secondary); }

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed; top: var(--header-height); left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-card); border-right: 1px solid var(--border);
    overflow-y: auto; z-index: 900;
    transition: transform var(--transition), background var(--transition);
    padding-bottom: 24px;
}
.sidebar.closed { transform: translateX(-100%); }

.sidebar-section { padding: 8px 12px; }
.sidebar-section-title {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--text-secondary);
    padding: 8px 12px 4px;
}
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-weight: 500; font-size: 0.9rem;
    transition: all var(--transition); text-decoration: none;
}
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(230,81,0,0.1); color: var(--primary);
}
.sidebar-link .icon { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-link .soon-badge {
    margin-left: auto; font-size: 0.65rem; font-weight: 700;
    background: var(--bg-secondary); color: var(--text-secondary);
    padding: 2px 6px; border-radius: 10px;
}
.sidebar-divider { height: 1px; background: var(--border); margin: 8px 16px; }

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 24px;
    min-height: calc(100vh - var(--header-height));
    transition: margin-left var(--transition);
}
.main-content.full-width { margin-left: 0; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.9rem;
    transition: all var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-secondary); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-secondary); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c62828; }
.btn-sm  { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg  { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ===== CARDS ===== */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
    transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-clickable:hover { transform: translateY(-2px); cursor: pointer; }

/* ===== FORM ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-error { color: var(--danger); font-size: 0.85rem; margin-top: 4px; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000; opacity: 0; visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--bg-card); border-radius: var(--radius); padding: 28px;
    width: 90%; max-width: 480px; max-height: 85vh; overflow-y: auto;
    box-shadow: var(--shadow-hover); transform: translateY(20px);
    transition: transform var(--transition);
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h2 { font-size: 1.2rem; font-weight: 700; }
.modal-close {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--bg-secondary); color: var(--text-secondary);
    font-size: 1.2rem; transition: background var(--transition);
}
.modal-close:hover { background: var(--border); }

/* ===== BADGE ===== */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-user    { background: #e3f2fd; color: #1565c0; }
.badge-admin   { background: #fce4ec; color: #c62828; }
[data-theme="dark"] .badge-user  { background: #1a3a5c; color: #90caf9; }
[data-theme="dark"] .badge-admin { background: #4a1520; color: #ef9a9a; }

/* ===== TOAST ===== */
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
    padding: 14px 20px; border-radius: var(--radius-sm);
    color: #fff; font-weight: 600; font-size: 0.9rem;
    box-shadow: var(--shadow-hover); max-width: 340px;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
}
.toast-success { background: var(--success); }
.toast-danger  { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info    { background: var(--info); }
@keyframes toastIn  { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(110%); } }

/* ===== ALERTS ===== */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.alert-danger  { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.alert-warning { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.alert-info    { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
[data-theme="dark"] .alert-success { background: #1b3a1e; border-color: #2e7d32; color: #a5d6a7; }
[data-theme="dark"] .alert-danger  { background: #4a1520; border-color: #c62828; color: #ef9a9a; }
[data-theme="dark"] .alert-warning { background: #3e2700; border-color: #e65100; color: #ffcc80; }
[data-theme="dark"] .alert-info    { background: #1a3a5c; border-color: #1565c0; color: #90caf9; }

/* ===== MOBILE MENU ===== */
.mobile-quick-menu { position: relative; }
.mobile-quick-btn {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--bg-secondary); border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text); transition: all var(--transition);
}
.mobile-quick-btn:hover { border-color: var(--primary); }
.mobile-quick-dropdown {
    display: none; position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); min-width: 200px;
    box-shadow: var(--shadow-hover); z-index: 200; overflow: hidden;
}
.mobile-quick-dropdown.open { display: block; }
.mq-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; font-size: 0.9rem; color: var(--text);
    background: none; width: 100%; text-align: left;
    transition: background var(--transition);
}
.mq-item:hover { background: var(--bg-secondary); }
.mq-divider { height: 1px; background: var(--border); }

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.4); z-index: 850;
}
.sidebar-overlay.active { display: block; }

/* ===== UTILITIES ===== */
.hidden  { display: none !important; }
.flex    { display: flex; }
.gap-8   { gap: 8px; }
.gap-16  { gap: 16px; }
.mt-8    { margin-top: 8px; }
.mt-16   { margin-top: 16px; }
.mt-24   { margin-top: 24px; }
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.font-bold { font-weight: 700; }

.hide-on-mobile  { }
.show-on-mobile  { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .hide-on-mobile  { display: none !important; }
    .show-on-mobile  { display: flex !important; }
    .mobile-menu-btn { display: flex; }
}

@media (max-width: 600px) {
    .main-content { padding: 16px; }
    .form-row { flex-direction: column; }
}
