/* ============================================
   VARIÁVEIS E RESET
   ============================================ */

:root {
    --primary: #b50914;
    --primary-dark: #8a0710;
    --primary-light: #d41a26;
    --dark: #0f0f0f;
    --dark-secondary: #1a1a1a;
    --dark-tertiary: #252525;
    --light: #ffffff;
    --gray-light: #e0e0e0;
    --gray-medium: #999999;
    --gray-dark: #333333;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --border-radius: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--dark);
    color: var(--light);
    line-height: 1.6;
    font-size: 16px;
}

/* ============================================
   LOGIN
   ============================================ */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-secondary) 100%);
    padding: 20px;
}

.login-box {
    background-color: var(--dark-secondary);
    padding: 40px;
    border-radius: var(--border-radius);
    border: 1px solid var(--primary);
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(181, 9, 20, 0.2);
    backdrop-filter: blur(10px);
}

.login-box h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--primary);
    text-align: center;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-box p {
    text-align: center;
    color: var(--gray-medium);
    margin-bottom: 30px;
    font-size: 14px;
}

.input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 15px;
    background-color: var(--dark);
    border: 1px solid var(--dark-tertiary);
    border-radius: 8px;
    color: var(--light);
    font-size: 16px;
    transition: var(--transition);
    font-family: inherit;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: rgba(181, 9, 20, 0.05);
    box-shadow: 0 0 0 3px rgba(181, 9, 20, 0.1);
}

.input::placeholder {
    color: var(--gray-medium);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--light);
    box-shadow: var(--shadow-md);
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
    background-color: var(--dark-tertiary);
    color: var(--light);
    border: 1px solid var(--gray-dark);
    width: auto;
}

.btn-secondary:hover {
    background-color: var(--gray-dark);
    border-color: var(--primary);
}

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

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

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

.btn-success:hover {
    background-color: #45a049;
}

.btn-small {
    padding: 8px 12px;
    font-size: 12px;
}

.login-hint {
    text-align: center;
    font-size: 12px;
    color: var(--gray-medium);
    margin-top: 20px;
}

/* ============================================
   DASHBOARD
   ============================================ */

.dashboard-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--dark);
}

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

.sidebar {
    width: 280px;
    background-color: var(--dark-secondary);
    border-right: 1px solid var(--dark-tertiary);
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.sidebar-header h2 {
    color: var(--primary);
    font-size: 22px;
    margin-bottom: 30px;
    letter-spacing: -0.5px;
    font-weight: 700;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--gray-medium);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
}

.menu-item:hover {
    background-color: var(--dark-tertiary);
    color: var(--light);
}

.menu-item.active {
    background-color: rgba(181, 9, 20, 0.1);
    border-left-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

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

.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background-color: var(--dark);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

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

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

.tab-content h2 {
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--light);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.tab-header h2 {
    margin: 0;
    flex: 1;
}

.tab-header .btn {
    flex-shrink: 0;
}

/* ============================================
   STATS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, var(--dark-secondary) 0%, var(--dark-tertiary) 100%);
    padding: 30px;
    border-radius: var(--border-radius);
    border: 1px solid var(--dark-tertiary);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.stat-value {
    font-size: 40px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.stat-label {
    font-size: 13px;
    color: var(--gray-medium);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* ============================================
   ITEMS LIST
   ============================================ */

.items-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.item-card {
    background-color: var(--dark-secondary);
    padding: 24px;
    border-radius: var(--border-radius);
    border: 1px solid var(--dark-tertiary);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.item-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(181, 9, 20, 0.1);
    transform: translateY(-4px);
}

.item-card h3 {
    color: var(--light);
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.item-card p {
    color: var(--gray-medium);
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.5;
    flex-grow: 1;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray-medium);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--dark-tertiary);
}

.item-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.item-actions button {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
}

/* ============================================
   FORMULÁRIOS
   ============================================ */

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--light);
    font-weight: 600;
    font-size: 14px;
}

textarea {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--dark);
    border: 1px solid var(--dark-tertiary);
    border-radius: 8px;
    color: var(--light);
    font-size: 16px;
    transition: var(--transition);
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: rgba(181, 9, 20, 0.05);
    box-shadow: 0 0 0 3px rgba(181, 9, 20, 0.1);
}

.settings-form {
    background-color: var(--dark-secondary);
    padding: 30px;
    border-radius: var(--border-radius);
    border: 1px solid var(--dark-tertiary);
    max-width: 600px;
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow-y: auto;
    backdrop-filter: blur(4px);
}

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

.modal-content {
    background-color: var(--dark-secondary);
    padding: 40px;
    border-radius: var(--border-radius);
    border: 1px solid var(--dark-tertiary);
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    margin: 20px auto;
    animation: slideUp 0.3s ease-out;
}

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

.close {
    color: var(--gray-medium);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.close:hover {
    color: var(--primary);
}

.modal-content h2 {
    margin-bottom: 24px;
    border: none;
    padding: 0;
    font-size: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.modal-actions button {
    flex: 1;
}

/* ============================================
   NOTIFICAÇÕES
   ============================================ */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--dark-secondary);
    border: 1px solid var(--dark-tertiary);
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    animation: slideInRight 0.3s ease-out;
    max-width: 400px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.success {
    border-left-color: var(--success);
}

.notification.error {
    border-left-color: var(--danger);
}

.notification.warning {
    border-left-color: var(--warning);
}

.notification-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--light);
}

.notification-message {
    font-size: 14px;
    color: var(--gray-medium);
}

/* ============================================
   RESPONSIVO - TABLET
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-left: 240px;
        padding: 20px;
    }

    .items-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .modal-content {
        padding: 30px;
    }
}

/* ============================================
   RESPONSIVO - MOBILE
   ============================================ */

@media (max-width: 768px) {
    :root {
        font-size: 14px;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--dark-tertiary);
        padding: 16px;
        box-shadow: none;
    }

    .sidebar-header h2 {
        font-size: 20px;
        margin-bottom: 16px;
    }

    .sidebar-menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .menu-item {
        flex: 1;
        min-width: 80px;
        padding: 10px 12px;
        font-size: 12px;
        justify-content: center;
        text-align: center;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .menu-item.active {
        border-left: none;
        border-bottom-color: var(--primary);
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
    }

    .tab-content h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .tab-header {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 20px;
    }

    .tab-header h2 {
        margin-bottom: 12px;
    }

    .tab-header .btn {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 24px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 32px;
    }

    .items-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .item-card {
        padding: 16px;
    }

    .item-actions {
        flex-direction: column;
    }

    .item-actions button {
        width: 100%;
    }

    .modal-content {
        padding: 24px;
        max-width: 95%;
    }

    .modal-content h2 {
        font-size: 20px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        font-size: 13px;
    }

    .input,
    textarea {
        font-size: 16px;
        padding: 12px 14px;
    }

    .settings-form {
        padding: 20px;
        max-width: 100%;
    }

    .login-box {
        padding: 30px 20px;
    }

    .login-box h1 {
        font-size: 28px;
    }

    .btn {
        padding: 12px 16px;
        font-size: 13px;
    }

    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* ============================================
   RESPONSIVO - MOBILE PEQUENO
   ============================================ */

@media (max-width: 480px) {
    :root {
        font-size: 13px;
    }

    .sidebar-header h2 {
        font-size: 18px;
    }

    .menu-item {
        min-width: 60px;
        padding: 8px 10px;
        font-size: 11px;
    }

    .tab-content h2 {
        font-size: 20px;
    }

    .stat-value {
        font-size: 28px;
    }

    .item-card {
        padding: 12px;
    }

    .item-card h3 {
        font-size: 14px;
    }

    .item-card p {
        font-size: 12px;
    }

    .modal-content {
        padding: 20px;
    }

    .login-box {
        padding: 24px 16px;
    }

    .login-box h1 {
        font-size: 24px;
    }

    .btn {
        padding: 10px 14px;
        font-size: 12px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }
}

/* ============================================
   SCROLLBAR CUSTOMIZADO
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--dark-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-dark);
}

/* ============================================
   ACESSIBILIDADE
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: light) {
    :root {
        --dark: #f5f5f5;
        --dark-secondary: #ffffff;
        --dark-tertiary: #e0e0e0;
        --light: #000000;
        --gray-medium: #666666;
        --gray-dark: #cccccc;
    }

    body {
        background-color: var(--dark);
        color: var(--light);
    }
}
