:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --secondary-color: #7209b7;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --info-color: #4895ef;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --gray-light: #e9ecef;
    --border-color: #dee2e6;
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --border-radius: 12px;
    --box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: var(--dark-color);
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(45deg, #4361ee, #3a56d4, #7209b7);
}

.login-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.login-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.message {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
}

.message-success {
    background: #d1e7dd;
    color: #0f5132;
    border-left: 4px solid #0f5132;
}

.message-error {
    background: #f8d7da;
    color: #842029;
    border-left: 4px solid #842029;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-form .form-group {
    margin-bottom: 25px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-form input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--light-color);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.password-input {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-color);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--primary-color);
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(67, 97, 238, 0.3);
}

.btn-block {
    width: 100%;
}

.login-footer {
    margin-top: 25px;
    text-align: center;
    color: var(--gray-color);
    font-size: 0.85rem;
}

.login-footer i {
    margin-right: 5px;
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.1;
}

.shape {
    position: absolute;
    background: var(--primary-color);
    border-radius: 50%;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
    background: linear-gradient(45deg, var(--info-color), var(--success-color));
}

.shape-3 {
    width: 100px;
    height: 100px;
    top: 50%;
    left: 30px;
    background: linear-gradient(45deg, var(--warning-color), var(--danger-color));
}

.login-footer-info {
    text-align: center;
    margin-top: 30px;
    color: white;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Dashboard Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: white;
    box-shadow: var(--box-shadow);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar-header {
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-color);
    cursor: pointer;
}

.sidebar-profile {
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.profile-info p {
    font-size: 0.85rem;
    color: var(--gray-color);
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: var(--gray-color);
    text-decoration: none;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.sidebar-menu a:hover {
    color: var(--primary-color);
    background: rgba(67, 97, 238, 0.05);
    border-left-color: var(--primary-color);
}

.sidebar-menu li.active a {
    color: var(--primary-color);
    background: rgba(67, 97, 238, 0.1);
    border-left-color: var(--primary-color);
}

.sidebar-menu i {
    font-size: 1.1rem;
    width: 24px;
}

.sidebar-menu span {
    font-size: 0.95rem;
    font-weight: 500;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    text-decoration: none;
}

.btn-logout:hover {
    background: #d11450;
    transform: translateY(-2px);
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: #f8f9fa;
    transition: var(--transition);
}

.topbar {
    height: var(--topbar-height);
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-left h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.breadcrumb {
    font-size: 0.85rem;
    color: var(--gray-color);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-notification {
    position: relative;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-notification:hover {
    background: var(--gray-light);
    color: var(--primary-color);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown {
    position: relative;
}

.btn-user {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--dark-color);
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-user:hover {
    background: var(--gray-light);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 200px;
    box-shadow: var(--box-shadow);
    border-radius: 8px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1001;
}

.user-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.dropdown-menu a:hover {
    background: var(--gray-light);
    color: var(--primary-color);
}

.dropdown-menu .divider {
    height: 1px;
    background: var(--border-color);
    margin: 10px 0;
}

.content {
    padding: 30px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: -15px;
}

.col-3 {
    width: 25%;
    padding: 15px;
}

.col-8 {
    width: 66.6667%;
    padding: 15px;
}

.col-4 {
    width: 33.3333%;
    padding: 15px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border-left: 5px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(45deg, var(--dark-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-info p {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header {
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark-color);
}

.card-body {
    padding: 25px;
}

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-color);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.token {
    font-family: 'Courier New', monospace;
    background: var(--gray-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--primary-color);
}

.btn-copy {
    background: none;
    border: none;
    color: var(--gray-color);
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 5px;
    transition: var(--transition);
    padding: 5px;
    border-radius: 4px;
}

.btn-copy:hover {
    background: var(--gray-light);
    color: var(--primary-color);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-free {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-basic {
    background: #e8f5e9;
    color: #388e3c;
}

.badge-premium {
    background: #fff3e0;
    color: #f57c00;
}

.badge-enterprise {
    background: #f3e5f5;
    color: #7b1fa2;
}

.status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-ativo {
    background: #d4edda;
    color: #155724;
}

.status-pendente {
    background: #fff3cd;
    color: #856404;
}

.status-bloqueado {
    background: #f8d7da;
    color: #721c24;
}

.actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: var(--gray-light);
    color: var(--gray-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-action:hover {
    transform: translateY(-2px);
}

.btn-edit:hover {
    background: var(--primary-color);
    color: white;
}

.btn-delete:hover {
    background: var(--danger-color);
    color: white;
}

.logs {
    max-height: 400px;
    overflow-y: auto;
}

.log-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.log-item:last-child {
    border-bottom: none;
}

.log-time {
    min-width: 60px;
    font-size: 0.85rem;
    color: var(--gray-color);
    font-weight: 500;
}

.log-content {
    flex: 1;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.log-user {
    font-weight: 500;
    color: var(--dark-color);
}

.log-status {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.log-details {
    font-size: 0.9rem;
    color: var(--gray-color);
}

.log-ip {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 6px;
    background: var(--gray-light);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.quick-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--light-color);
    border-radius: 10px;
    transition: var(--transition);
}

.quick-stat:hover {
    transform: translateX(5px);
    background: white;
    box-shadow: var(--box-shadow);
}

.quick-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.quick-stat-info h4 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.quick-stat-info p {
    font-size: 0.85rem;
    color: var(--gray-color);
}

.usage-chart {
    height: 200px;
    position: relative;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-color);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-light);
    color: var(--danger-color);
}

.modal-form {
    padding: 25px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
    background: var(--light-color);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--gray-color);
    font-size: 0.8rem;
}

.input-with-radio {
    display: flex;
    gap: 15px;
    align-items: center;
}

.radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    transition: var(--transition);
}

.radio-group label:hover {
    background: var(--gray-light);
}

.radio-group input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.modal-footer {
    padding: 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.btn-secondary {
    background: var(--gray-color);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Alert */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #155724;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #721c24;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
}

/* Responsive */
@media (max-width: 1200px) {
    .col-3 {
        width: 50%;
    }
    .col-8, .col-4 {
        width: 100%;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .col-3 {
        width: 100%;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .modal-content {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
}