/* ==========================================================================
   FINCLOUD - LICENSING CONTROL PANEL CSS
   Aesthetic: Dark Mode Glassmorphism with Gradient Accents & Micro-Animations
   ========================================================================== */

   :root {
    --bg-dark: #090b16;
    --panel-bg: rgba(15, 20, 42, 0.45);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-border-hover: rgba(255, 255, 255, 0.15);
    
    /* Brand Colors (Gradients & Accents) */
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-red: #f43f5e;
    --accent-yellow: #f59e0b;
  
    /* Font Colors */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    /* Layout Sizes */
    --sidebar-width: 260px;
    --transition-speed: 0.3s;
    --transition-curve: cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  /* ─── RESET & INITIALS ─────────────────────────────────────────────────── */
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
  }
  
  body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: stretch;
  }
  
  /* ─── SCROLLBAR ────────────────────────────────────────────────────────── */
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  
  ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
  }
  
  ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
  }
  
  /* ─── UTILITIES & GLASSMORPHISM ────────────────────────────────────────── */
  .glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    transition: border var(--transition-speed) var(--transition-curve), 
                box-shadow var(--transition-speed) var(--transition-curve);
  }
  
  .glass-panel:hover {
    border-color: var(--panel-border-hover);
  }
  
  .text-gradient {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  .text-gradient-purple {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  .text-gradient-blue {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  .hidden {
    display: none !important;
  }
  
  .text-center {
    text-align: center;
  }
  
  .text-muted {
    color: var(--text-muted) !important;
  }
  
  .text-green { color: var(--accent-green); }
  .text-red { color: var(--accent-red); }
  .text-yellow { color: var(--accent-yellow); }
  .text-cyan { color: var(--accent-cyan); }
  
  /* ─── DYNAMIC BACKGROUND GLOWS ─────────────────────────────────────────── */
  .bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
    animation: pulse 12s infinite alternate ease-in-out;
  }
  
  .bg-glow-1 {
    top: -10%;
    left: -10%;
    background: var(--accent-purple);
  }
  
  .bg-glow-2 {
    bottom: -10%;
    right: -10%;
    background: var(--accent-blue);
    animation-delay: 4s;
  }
  
  @keyframes pulse {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.15) translate(50px, 30px); }
  }
  
  /* ─── BUTTONS ──────────────────────────────────────────────────────────── */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s var(--transition-curve);
    outline: none;
    color: #fff;
  }
  
  .btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
  }
  
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  }
  
  .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
  }
  
  .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
  }
  
  .btn-danger {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: var(--accent-red);
  }
  
  .btn-danger:hover {
    background: var(--accent-red);
    color: #fff;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
  }
  
  .btn-icon {
    padding: 8px;
    border-radius: 8px;
  }
  
  .btn-block {
    display: flex;
    width: 100%;
  }
  
  /* ─── TOAST NOTIFICATIONS ──────────────────────────────────────────────── */
  .toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
  }
  
  .toast {
    pointer-events: auto;
    width: 320px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(18, 24, 48, 0.9);
    border-left: 4px solid var(--accent-blue);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: slideIn 0.3s var(--transition-curve);
    backdrop-filter: blur(10px);
  }
  
  .toast.success { border-left-color: var(--accent-green); }
  .toast.error { border-left-color: var(--accent-red); }
  .toast.warning { border-left-color: var(--accent-yellow); }
  
  .toast-icon {
    font-size: 18px;
    margin-top: 2px;
  }
  
  .toast-body h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
  }
  
  .toast-body p {
    font-size: 12px;
    color: var(--text-secondary);
  }
  
  @keyframes slideIn {
    from { transform: translateX(100%) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
  }
  
  /* ─── LOGIN PANEL ──────────────────────────────────────────────────────── */
  .login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 24px;
  }
  
  .login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.5s var(--transition-curve);
  }
  
  .login-header {
    text-align: center;
    margin-bottom: 32px;
  }
  
  .logo-icon {
    position: relative;
    display: inline-flex;
    font-size: 32px;
    margin-bottom: 16px;
    height: 60px;
    width: 60px;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
  }
  
  .logo-icon .fa-key-skeleton {
    opacity: 0.15;
    position: absolute;
  }
  
  .login-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
  }
  
  .login-header p {
    font-size: 13px;
    color: var(--text-muted);
  }
  
  /* Forms */
  .form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
  }
  
  .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
  }
  
  .input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 14px;
  }
  
  input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #fff;
    outline: none;
    font-size: 14px;
    transition: all 0.25s var(--transition-curve);
  }
  
  .input-wrapper input {
    padding-left: 42px;
  }
  
  .input-wrapper input[type="password"] {
    padding-right: 42px;
  }
  
  .toggle-password {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
  }
  
  .toggle-password:hover {
    color: #fff;
  }
  
  input:focus, select:focus, textarea:focus {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
  }
  
  .input-disabled {
    opacity: 0.6;
    background: rgba(255,255,255, 0.01) !important;
    cursor: not-allowed;
  }
  
  .form-hint {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
  }
  
  /* ─── DASHBOARD WRAPPER ────────────────────────────────────────────────── */
  .dashboard-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    animation: fadeIn 0.5s var(--transition-curve);
  }
  
  /* Sidebar */
  .sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    margin: 16px 0 16px 16px;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
  }
  
  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 24px;
  }
  
  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
  }
  
  .badge {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(59, 130, 246, 0.2);
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
  }
  
  .sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
  }
  
  .menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.25s var(--transition-curve);
  }
  
  .menu-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--text-muted);
    transition: color 0.25s;
  }
  
  .menu-item:hover, .menu-item.active {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
  }
  
  .menu-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.05));
    border-left: 3px solid var(--accent-blue);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
  
  .menu-item.active i {
    color: var(--accent-cyan);
  }
  
  .sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  
  /* Content Area */
  .content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 32px 32px 32px 24px;
    overflow-y: auto;
    max-height: 100vh;
  }
  
  /* Topbar */
  .topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
  }
  
  .page-title h1 {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 4px;
  }
  
  .page-title p {
    font-size: 13px;
    color: var(--text-muted);
  }
  
  .admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 30px;
  }
  
  .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
  }
  
  .admin-profile span {
    font-size: 13px;
    font-weight: 500;
  }
  
  /* ─── TAB CONTENT: OVERVIEW ────────────────────────────────────────────── */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
  }
  
  .stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
  }
  
  .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
  }
  
  .purple-glow { background: rgba(139, 92, 246, 0.1); color: var(--accent-purple); }
  .green-glow { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); }
  .red-glow { background: rgba(244, 63, 94, 0.1); color: var(--accent-red); }
  .yellow-glow { background: rgba(245, 158, 11, 0.1); color: var(--accent-yellow); }
  
  /* Border Glows */
  .border-glow-purple:hover { box-shadow: 0 0 20px rgba(139, 92, 246, 0.15); border-color: rgba(139, 92, 246, 0.3); }
  .border-glow-green:hover { box-shadow: 0 0 20px rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.3); }
  .border-glow-red:hover { box-shadow: 0 0 20px rgba(244, 63, 94, 0.15); border-color: rgba(244, 63, 94, 0.3); }
  .border-glow-yellow:hover { box-shadow: 0 0 20px rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.3); }
  
  .stat-info h3 {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
  }
  
  .stat-info p {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
  }
  
  /* Table Layouts */
  .recent-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  
  .card-header {
    margin-bottom: 4px;
  }
  
  .card-header h2 {
    font-size: 18px;
    font-weight: 600;
  }
  
  .card-header p {
    font-size: 12px;
    color: var(--text-muted);
  }
  
  .table-container {
    overflow-x: auto;
    border-radius: 12px;
  }
  
  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
  }
  
  th, td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }
  
  th {
    background: rgba(255, 255, 255, 0.01);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
  }
  
  tr:last-child td {
    border-bottom: none;
  }
  
  tr:hover td {
    background: rgba(255, 255, 255, 0.015);
  }
  
  /* Status Badges */
  .status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
  }
  
  .status-pill.success { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.2); }
  .status-pill.danger { background: rgba(244, 63, 94, 0.1); color: var(--accent-red); border: 1px solid rgba(244, 63, 94, 0.2); }
  .status-pill.warning { background: rgba(245, 158, 11, 0.1); color: var(--accent-yellow); border: 1px solid rgba(245, 158, 11, 0.2); }
  .status-pill.info { background: rgba(6, 182, 212, 0.1); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.2); }
  
  /* ─── TAB CONTENT: LICENSES ─── */
  .action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
  }
  
  .search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex-grow: 1;
    max-width: 400px;
  }
  
  .search-box i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
  }
  
  .search-box input {
    padding-left: 42px;
  }
  
  /* Code Blocks */
  code {
    font-family: 'Space Grotesk', monospace;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  
  .license-key-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: 'Space Grotesk', monospace;
    font-weight: 500;
  }
  
  .license-key-copy:hover {
    color: var(--accent-cyan);
  }
  
  .license-key-copy i {
    font-size: 11px;
    opacity: 0.6;
  }
  
  /* Table Actions */
  .table-actions {
    display: flex;
    gap: 6px;
  }
  
  /* ─── TAB CONTENT: SETTINGS ─── */
  .settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 24px;
  }
  
  .settings-card {
    padding: 32px;
  }
  
  .border-bottom {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 20px;
    margin-bottom: 24px;
  }
  
  .settings-form {
    display: flex;
    flex-direction: column;
  }
  
  .integration-guide pre {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 16px 0;
  }
  
  .integration-guide code {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--text-secondary);
  }
  
  .alert-info-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 10px;
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    font-size: 12px;
    line-height: 1.5;
  }
  
  .alert-info-box i {
    font-size: 16px;
    margin-top: 2px;
  }
  
  /* ─── MODALS ───────────────────────────────────────────────────────────── */
  .modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 6, 15, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 24px;
    animation: fadeIn 0.3s var(--transition-curve);
  }
  
  .modal-content {
    width: 100%;
    max-width: 500px;
    padding: 32px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
    position: relative;
    animation: slideUp 0.3s var(--transition-curve);
  }
  
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
  }
  
  .modal-header h2 {
    font-size: 20px;
    font-weight: 700;
  }
  
  .btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
  }
  
  .btn-close-modal:hover {
    color: #fff;
  }
  
  .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  @keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  
  /* ─── MEDIA QUERY ──────────────────────────────────────────────────────── */
  @media (max-width: 900px) {
    .dashboard-wrapper {
      flex-direction: column;
    }
    
    .sidebar {
      width: auto;
      margin: 16px;
    }
    
    .content-area {
      padding: 16px;
    }
    
    .stats-grid {
      grid-template-columns: 1fr 1fr;
    }
  }
  
  @media (max-width: 600px) {
    .stats-grid {
      grid-template-columns: 1fr;
    }
    .topbar {
      flex-direction: column;
      align-items: flex-start;
      gap: 16px;
    }
    .action-bar {
      flex-direction: column;
      align-items: stretch;
    }
    .search-box {
      max-width: none;
    }
  }
