/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Jost', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7C3AED 0%, #1E1B4B 100%);
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 48px;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header i {
    font-size: 48px;
    color: #7C3AED;
    margin-bottom: 16px;
}

.login-header h1 {
    font-family: 'Jost', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.login-header p {
    color: #64748b;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #7C3AED;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
}

/* Buttons */
.btn {
    font-family: 'Jost', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #7C3AED;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #7C3AED;
    border: 2px solid #7C3AED;
}

.btn-outline:hover {
    background: #7C3AED;
    color: white;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

/* Admin Panel Layout */
.admin-panel {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    font-family: 'Jost', sans-serif;
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 18px;
    color: #1e293b;
    flex-shrink: 0; /* Prevents header from being compressed */
}

.sidebar-header i {
    color: #7C3AED;
    font-size: 24px;
}

.sidebar-header img {
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* Important for flex to work correctly */
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.nav-item.active {
    background: #7C3AED;
    color: white;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0; /* Prevents footer from being compressed */
    background: white; /* Ensures visibility */
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: #1e293b;
}

.user-info i {
    color: #7C3AED;
    font-size: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 32px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 32px;
    gap: 16px;
}

.page-header h1 {
    font-family: 'Jost', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
}

.page-header p {
    color: #64748b;
    font-size: 16px;
}

.page-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #7C3AED;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-content h3 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.stat-content p {
    color: #64748b;
    font-size: 14px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.dashboard-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

/* Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.app-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: transform 0.2s;
}

.app-card:hover {
    transform: translateY(-2px);
}

.app-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.app-title h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.app-title p {
    color: #64748b;
    font-size: 14px;
}

.app-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.app-status.active {
    background: #dcfce7;
    color: #166534;
}

.app-status.inactive {
    background: #fef2f2;
    color: #dc2626;
}

.app-pricing {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.pricing-item {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 8px;
}

.pricing-item:last-child {
    margin-bottom: 0;
}

.pricing-currency {
    font-weight: 500;
    color: #374151;
}

.pricing-value {
    font-weight: 600;
    color: #1e293b;
}

/* Tables */
.licenses-table, .users-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.table-header {
    background: #f8fafc;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr auto auto;
    gap: 16px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.table-row {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr auto auto;
    gap: 16px;
    align-items: center;
    transition: background 0.2s;
}

.table-row:hover {
    background: #f8fafc;
}

.table-row:last-child {
    border-bottom: none;
}

.table-cell {
    font-size: 14px;
    color: #1e293b;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;  /* Allow buttons to wrap to next line */
    gap: 8px;
}

/* Ensure buttons don't shrink too much when wrapping */
.table-actions .btn {
    flex-shrink: 0;  /* Prevent buttons from shrinking */
    min-width: fit-content;  /* Keep button text readable */
}

/* Specific styling for table-actions inside app-card */
.app-card .table-actions {
    margin-top: 16px;
    width: 100%;  /* Ensure it takes full width of card */
}

/* Forms */
/* Form elements with light backgrounds */
.form-select,
input,
select,
textarea {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white !important;
    color: #1e293b !important;
}

.form-select:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #7C3AED;
    background: white !important;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.settings-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.settings-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.server-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.server-info-item {
    display: flex;
    justify-content: between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.server-info-item:last-child {
    border-bottom: none;
}

.server-info-label {
    font-weight: 500;
    color: #374151;
}

.server-info-value {
    color: #1e293b;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px 24px 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.modal-header h3 {
    font-family: 'Jost', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.modal-close:hover {
    background: #f1f5f9;
}

.modal-body {
    padding: 0 24px 24px 24px;
}

/* Ensure form elements in modals have light backgrounds */
.modal input,
.modal select,
.modal textarea {
    background: white !important;
    color: #1e293b !important;
}

/* Force light backgrounds on all form elements globally */
* input,
* select,
* textarea {
    background: white !important;
    color: #1e293b !important;
    border: 2px solid #e2e8f0 !important;
}

/* Specific overrides for admin panel */
.admin-panel input,
.admin-panel select,
.admin-panel textarea {
    background: white !important;
    color: #1e293b !important;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-spinner {
    text-align: center;
    color: #7C3AED;
}

.loading-spinner i {
    font-size: 32px;
    margin-bottom: 16px;
}

/* List Container */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
    border-left: 4px solid #7C3AED;
}

.list-item h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.list-item p {
    font-size: 12px;
    color: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .table-header, .table-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .table-header {
        display: none;
    }
    
    .table-cell {
        display: flex;
        justify-content: between;
        align-items: center;
    }
    
    .table-cell::before {
        content: attr(data-label);
        font-weight: 600;
        color: #374151;
        margin-right: 8px;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-4 {
    margin-bottom: 16px;
}

.mt-4 {
    margin-top: 16px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid #7C3AED;
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast.info {
    border-left-color: #3b82f6;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast.warning .toast-icon {
    color: #f59e0b;
}

.toast.info .toast-icon {
    color: #3b82f6;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #1e293b;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.fade-out {
    animation: slideOutRight 0.3s ease-out forwards;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Visibility Classes for JavaScript Control */
.hidden {
    display: none !important;
}

.visible {
    display: flex !important;
}

@media (max-width: 640px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }
}

/* ══════════════════════════════════════════════════════════════════
   ADMIN UNIVERSAL — BADGES & CONTAS
   ══════════════════════════════════════════════════════════════════ */

/* Badges de status */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.badge-free {
  background: #f1f5f9;
  color: #64748b;
}

.badge-premium {
  background: #fef3c7;
  color: #92400e;
}

.badge-active {
  background: #dcfce7;
  color: #166534;
}

.badge-inactive {
  background: #fef2f2;
  color: #dc2626;
}

.badge-expired {
  background: #fef2f2;
  color: #dc2626;
}

/* Accounts Table — grid dinâmico com mais colunas */
.accounts-table {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.accounts-table .table-header {
  display: grid;
  grid-template-columns: 80px 1fr 120px 120px 120px 120px 160px auto;
}

.accounts-table .table-row {
  display: grid;
  grid-template-columns: 80px 1fr 120px 120px 120px 120px 160px auto;
}

/* Account Detail */
.account-detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.account-detail-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #7C3AED;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
}

.account-detail-info h2 {
  font-family: 'Jost', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #1e293b;
}

.account-detail-info p {
  color: #64748b;
  font-size: 14px;
}

/* Provider Cards */
.provider-section {
  margin-bottom: 32px;
}

.provider-section-title {
  font-family: 'Jost', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.provider-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.provider-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 16px;
}

/* Info grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.info-item {
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
}

.info-item label {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
  font-weight: 500;
}

.info-item .value {
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
}

/* Subscription history table */
.sub-history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.sub-history-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  border-bottom: 2px solid #e2e8f0;
}

.sub-history-table td {
  padding: 8px 12px;
  font-size: 13px;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
}

.sub-history-table tr:last-child td {
  border-bottom: none;
}

/* Page actions with search */
.page-actions-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  min-width: 250px;
  padding: 10px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: #7C3AED;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 24px;
}

.pagination .btn {
  padding: 8px 16px;
  font-size: 13px;
}

.pagination .page-info {
  font-size: 14px;
  color: #64748b;
  padding: 0 12px;
} 
