/**
 * Account Hub — Main stylesheet.
 * Clean, modern, minimal design.
 */

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --danger: #DC2626;
    --danger-dark: #B91C1C;
    --success: #16A34A;
    --warning: #F59E0B;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-500: #6B7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================================
   Auth pages (login, register, etc) — centered card
   ============================================================ */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.auth-card p.subtitle {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ============================================================
   Form elements
   ============================================================ */

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--gray-700);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group .error-msg {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-decoration: none;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

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

.btn-danger:hover {
    background: var(--danger-dark);
    text-decoration: none;
}

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
    text-decoration: none;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

/* ============================================================
   Alerts
   ============================================================ */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-error {
    background: #FEF2F2;
    color: var(--danger);
    border: 1px solid #FECACA;
}

.alert-success {
    background: #F0FDF4;
    color: var(--success);
    border: 1px solid #BBF7D0;
}

.alert-warning {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}

/* ============================================================
   Links in auth pages
   ============================================================ */

.auth-link {
    text-align: center;
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 20px;
}

.auth-link a {
    color: var(--primary);
    font-weight: 500;
}

/* ============================================================
   Dashboard layout
   ============================================================ */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: white;
    border-right: 1px solid var(--gray-200);
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar-logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 12px;
}

.sidebar-logo h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-logo span {
    font-size: 12px;
    color: var(--gray-500);
}

.sidebar-nav a {
    display: block;
    padding: 10px 20px;
    color: var(--gray-700);
    font-size: 14px;
    transition: background 0.15s;
}

.sidebar-nav a:hover {
    background: var(--gray-50);
    text-decoration: none;
}

.sidebar-nav a.active {
    background: #EEF2FF;
    color: var(--primary);
    font-weight: 500;
}

.sidebar-nav a.danger {
    color: var(--danger);
}

/* Main content */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
}

/* ============================================================
   Account cards
   ============================================================ */

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

.account-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 20px;
    transition: box-shadow 0.2s, transform 0.1s;
}

.account-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.account-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.account-card .description {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-card .meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 12px;
    color: var(--gray-500);
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
}

.badge-active {
    background: #DCFCE7;
    color: #166534;
}

.badge-expired {
    background: #FEF2F2;
    color: #991B1B;
}

.badge-suspended {
    background: var(--gray-100);
    color: var(--gray-700);
}

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

/* ============================================================
   Detail page
   ============================================================ */

.detail-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.detail-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.license-key-display {
    font-family: 'Courier New', monospace;
    background: var(--gray-100);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.license-key-display code {
    flex: 1;
    word-break: break-all;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--gray-500);
    font-size: 14px;
}

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

/* ============================================================
   Empty state
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state h3 {
    font-size: 18px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
        padding: 12px 0;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
    }

    .sidebar-nav a {
        white-space: nowrap;
        padding: 8px 14px;
    }

    .accounts-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
