/* assets/css/common.css - Design System Global LicensaCore */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Cores do Tema Escuro Moderno (SaaS Premium) */
    --bg-primary: #0b0f19;
    --bg-surface: #111827;
    --bg-surface-elevated: #1f2937;
    --bg-glass: rgba(17, 24, 39, 0.75);
    --border-color: #374151;
    --border-subtle: rgba(255, 255, 255, 0.08);

    /* Textos */
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* Cores Semânticas de Destaque */
    --brand-primary: #6366f1;
    --brand-primary-hover: #4f46e5;
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    
    /* Estados de Licença */
    --status-active: #10b981;
    --status-active-bg: rgba(16, 185, 129, 0.12);
    --status-active-border: rgba(16, 185, 129, 0.3);

    --status-warning: #f59e0b;
    --status-warning-bg: rgba(245, 158, 11, 0.12);
    --status-warning-border: rgba(245, 158, 11, 0.3);

    --status-grace: #a855f7;
    --status-grace-bg: rgba(168, 85, 247, 0.15);
    --status-grace-border: rgba(168, 85, 247, 0.35);

    --status-expired: #ef4444;
    --status-expired-bg: rgba(239, 68, 68, 0.12);
    --status-expired-border: rgba(239, 68, 68, 0.3);

    --status-suspended: #64748b;
    --status-suspended-bg: rgba(100, 116, 139, 0.15);
    --status-suspended-border: rgba(100, 116, 139, 0.3);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-subtle: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-elevated: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Utilitários Tipográficos e Layout */
a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: #818cf8;
}

.mono {
    font-family: var(--font-mono);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.badge-active {
    background: var(--status-active-bg);
    color: var(--status-active);
    border: 1px solid var(--status-active-border);
}

.badge-warning {
    background: var(--status-warning-bg);
    color: var(--status-warning);
    border: 1px solid var(--status-warning-border);
}

.badge-grace {
    background: var(--status-grace-bg);
    color: var(--status-grace);
    border: 1px solid var(--status-grace-border);
}

.badge-expired {
    background: var(--status-expired-bg);
    color: var(--status-expired);
    border: 1px solid var(--status-expired-border);
}

.badge-suspended {
    background: var(--status-suspended-bg);
    color: var(--status-suspended);
    border: 1px solid var(--status-suspended-border);
}

.badge-plan {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    user-select: none;
}

.btn-primary {
    background: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover {
    background: var(--brand-primary-hover);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
    color: #fff;
}

.btn-gradient {
    background: var(--brand-gradient);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35);
}
.btn-gradient:hover {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.55);
    transform: translateY(-1px);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background: #374151;
    border-color: #4b5563;
}

.btn-success {
    background: #059669;
    color: #fff;
}
.btn-success:hover {
    background: #10b981;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: #ef4444;
    color: #fff;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

/* Campos de Formulário */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    background: #151d2f;
}
.form-control.mono {
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-subtle);
    backdrop-filter: blur(12px);
    transition: border-color 0.2s ease;
}
.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Tabelas */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}
.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}
.table th {
    background: var(--bg-surface-elevated);
    padding: 12px 16px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}
.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}
.table tr:last-child td {
    border-bottom: none;
}
.table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Modais */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 20px;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: var(--shadow-elevated);
    transform: scale(0.95);
    transition: transform 0.25s ease;
}
.modal-overlay.active .modal-content {
    transform: scale(1);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 14px;
}
.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover {
    color: var(--text-primary);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10000;
}
.toast {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    animation: toastSlideIn 0.3s ease forwards;
}
.toast-success {
    border-left: 4px solid var(--status-active);
}
.toast-error {
    border-left: 4px solid var(--status-expired);
}
.toast-warning {
    border-left: 4px solid var(--status-warning);
}

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