/* ─── Registration Manager - Complete Stylesheet ─── */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #eef2ff;
    --secondary: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.1), 0 4px 10px rgba(0,0,0,.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* ─── Layout ─── */
.wrapper { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--dark), #0f172a);
    color: white;
    padding: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform .3s;
}
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-header h2 { font-size: 18px; font-weight: 700; }
.sidebar-header p { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.sidebar-nav { list-style: none; padding: 12px 0; }
.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--gray-300);
    text-decoration: none;
    font-size: 14px;
    transition: all .15s;
    border-left: 3px solid transparent;
}
.sidebar-nav li a:hover, .sidebar-nav li a.active {
    background: rgba(255,255,255,.08);
    color: white;
    border-left-color: var(--primary);
}
.sidebar-nav li a .icon { font-size: 18px; width: 24px; text-align: center; }
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px 30px;
    min-height: 100vh;
}

/* ─── Top Bar ─── */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}
.top-bar h1 { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.top-bar .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--gray-500);
}
.breadcrumb { font-size: 13px; color: var(--gray-400); margin-bottom: 16px; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ─── Cards ─── */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-100);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}
.card-header h2 { font-size: 18px; font-weight: 600; color: var(--gray-800); }
.card-header h3 { font-size: 16px; font-weight: 600; color: var(--gray-800); }

/* ─── Stats Grid ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    border: 1px solid var(--gray-100);
    position: relative;
    overflow: hidden;
}
.stat-card .stat-icon {
    position: absolute;
    top: 16px; right: 16px;
    font-size: 32px;
    opacity: .12;
}
.stat-card .stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}
.stat-card .stat-sub {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 8px;
}
.stat-card.accent-primary { border-left: 4px solid var(--primary); }
.stat-card.accent-success { border-left: 4px solid var(--success); }
.stat-card.accent-warning { border-left: 4px solid var(--warning); }
.stat-card.accent-danger { border-left: 4px solid var(--danger); }
.stat-card.accent-info { border-left: 4px solid var(--secondary); }

/* ─── Tables ─── */
.table-container { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--gray-200);
    font-size: 13px;
    white-space: nowrap;
}
td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
tr:hover td { background: var(--gray-50); }
tr:last-child td { border-bottom: none; }

/* ─── Forms ─── */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.form-group .hint {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: var(--gray-800);
    background: white;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
textarea { min-height: 100px; resize: vertical; }
.input-error { border-color: var(--danger) !important; }
.error-text { color: var(--danger); font-size: 12px; margin-top: 2px; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-info { background: var(--secondary); color: white; }
.btn-outline { background: transparent; color: var(--gray-600); border: 1.5px solid var(--gray-200); }
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 16px 32px; font-size: 17px; }
.btn-block { width: 100%; display: flex; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ─── Alerts ─── */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert .close {
    margin-left: auto;
    cursor: pointer;
    font-size: 18px;
    opacity: .5;
    background: none;
    border: none;
}
.alert .close:hover { opacity: 1; }

/* ─── Badges / Tags ─── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-green { background: #d1fae5; color: #065f46; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ─── Auth Pages ─── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}
.auth-box {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 48px;
    width: 100%;
    max-width: 520px;
}
.auth-box .logo { text-align: center; margin-bottom: 8px; }
.auth-box .logo h1 { font-size: 24px; font-weight: 800; color: var(--gray-900); }
.auth-box .logo p { color: var(--gray-500); font-size: 14px; margin-top: 4px; }
.auth-box .divider {
    text-align: center;
    color: var(--gray-400);
    font-size: 13px;
    margin: 16px 0;
    position: relative;
}
.auth-box .divider::before,
.auth-box .divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: var(--gray-200);
}
.auth-box .divider::before { left: 0; }
.auth-box .divider::after { right: 0; }

/* ─── Modal ─── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-400);
    line-height: 1;
}

/* ─── Key Display ─── */
.key-display {
    background: var(--gray-50);
    border: 2px dashed var(--primary);
    border-radius: 8px;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
    color: var(--primary);
    word-break: break-all;
    margin: 12px 0;
}

/* ─── Product Cards ─── */
.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.software-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    border: 1px solid var(--gray-100);
    transition: all .15s;
    cursor: pointer;
}
.software-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.software-card .icon {
    width: 48px; height: 48px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}
.software-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.software-card p { font-size: 13px; color: var(--gray-500); margin-bottom: 12px; }
.software-card .price { font-size: 22px; font-weight: 700; color: var(--primary); }

/* ─── Tabs ─── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 20px;
}
.tab {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
}
.tab:hover { color: var(--gray-700); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; color: var(--gray-600); margin-bottom: 8px; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .software-grid { grid-template-columns: 1fr; }
    .top-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ─── Utility ─── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
}
.copy-btn:hover { color: var(--primary); }

/* Toast notification */
.toast {
    position: fixed;
    top: 20px; right: 20px;
    padding: 14px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    transform: translateX(120%);
    transition: transform .3s ease;
    max-width: 360px;
}
.toast.show { transform: translateX(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

/* ─── License Agreement Box ─── */
.agreement-box {
    margin-top: 20px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    background: var(--gray-50);
}
.agreement-header {
    padding: 10px 16px;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.agreement-content {
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.7;
    color: var(--gray-600);
    white-space: pre-wrap;
    background: white;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--gray-100);
    border-top: 1px solid var(--gray-200);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}
.purchase-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
