/* admin.css — STTech Admin Dashboard Styles */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --primary: hsl(218, 100%, 52%);
    --primary-light: hsl(218, 100%, 65%);
    --primary-dark: hsl(218, 100%, 40%);
    --sidebar-bg: #0f172a;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #f8fafc;

    --bg-page: #f1f5f9;
    --bg-card: #ffffff;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 16px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08);

    --font: 'Inter', sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;
    --tr: all 0.2s ease;
}

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

body {
    font-family: var(--font);
    background: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px;
}

input,
textarea,
select,
button {
    font-family: var(--font);
    outline: none;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ─── Login Page ──────────────────────────── */
.login-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, hsla(218, 100%, 52%, 0.15) 0%, transparent 60%);
    top: -100px;
    left: -100px;
    border-radius: 50%;
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: var(--r-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
}

.login-card h1 {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.login-card p {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

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

.form-group label {
    display: block;
    color: #cbd5e1;
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--r-sm);
    color: #fff;
    font-size: 0.9rem;
    transition: var(--tr);
}

.form-group input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.3);
}

.btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--r-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--tr);
}

.btn-primary:hover {
    background: var(--primary-light);
}

/* ─── Admin Layout ────────────────────────── */
html {
    height: 100% !important;
}

.admin-layout {
    display: flex !important;
    height: 100vh !important;
    min-height: 100vh !important;
    overflow: hidden !important;
}

/* Sidebar */
.sidebar {
    width: 260px !important;
    height: 100% !important;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0;
    transition: var(--tr);
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: #fff;
    gap: 12px;
}

.sidebar-nav {
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--r-sm);
    color: var(--sidebar-text);
    font-weight: 500;
    cursor: pointer;
    transition: var(--tr);
}

.nav-item i {
    font-size: 1.2rem;
}

.nav-item:hover,
.nav-item.active {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.nav-item.active {
    box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.admin-info strong {
    display: block;
    color: #fff;
    font-size: 0.85rem;
}

.admin-info small {
    color: var(--sidebar-text);
    font-size: 0.75rem;
}

/* Main Content Area */
.main-wrapper {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    height: 100% !important;
}

/* Header */
.top-header {
    height: 70px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.header-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    font-family: var(--font-heading);
}

.header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-page);
    border: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--tr);
    font-size: 1.1rem;
}

.icon-btn:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

/* Content Scrollable */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── UI Components ───────────────────────── */
/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.card-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.stat-info span {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-info h2 {
    font-size: 2rem;
    font-family: var(--font-heading);
    margin-top: 4px;
    color: var(--text-main);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.s-blue {
    background: rgba(30, 100, 255, 0.1);
    color: var(--primary);
}

.s-green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.s-purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.s-orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* Data Table */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f8fafc;
}

.data-table td {
    font-size: 0.9rem;
    color: var(--text-main);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-primary {
    background: rgba(30, 100, 255, 0.1);
    color: var(--primary);
    border: 1px solid rgba(30, 100, 255, 0.2);
}

/* Action Buttons */
.action-btns {
    display: flex;
    gap: 6px;
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--tr);
}

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

.btn-action.delete:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* Control Bar (e.g. above table) */
.control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 0 14px;
    width: 300px;
}

.search-box i {
    color: var(--text-muted);
}

.search-box input {
    border: none;
    padding: 10px;
    width: 100%;
    font-size: 0.85rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--tr);
}

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

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

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

.btn-outline {
    background: #fff;
    border-color: var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--text-muted);
}

.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-top: -9px;
    margin-left: -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

.btn-outline.loading::after {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.modal-lg {
    max-width: 900px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 0.9rem;
    background: #f8fafc;
    color: #1e293b;
    /* Chữ màu đen đậm */
    transition: var(--tr);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(30, 100, 255, 0.08);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--tr);
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: #fff;
    border-radius: var(--r-md);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show .modal-container {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-family: var(--font-heading);
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
    border-bottom-left-radius: var(--r-md);
    border-bottom-right-radius: var(--r-md);
}

/* Forms inside Modal */
.form-group-light {
    margin-bottom: 18px;
}

.form-group-light label {
    display: block;
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 0.9rem;
    transition: var(--tr);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 100, 255, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Container */
.toast-container {
    position: fixed;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    z-index: 9999;
}

/* Toast */
.toast {
    min-width: 200px;
    max-width: 300px;

    padding: 10px 14px;
    border-radius: 8px;

    background: #ffffff !important;
    color: #1e293b;

    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 13px;
    font-weight: 500;

    height: auto !important;
    flex: 0 0 auto !important;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-left: 3px solid #10b981;

    transform: translateY(20px);
    opacity: 0;
    transition: all 0.25s ease;
}

/* Show */
.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Icon */
.toast i {
    font-size: 16px;
    flex-shrink: 0;
}

/* Text */
.toast p {
    margin: 0;
    color: #334155;
    line-height: 1.4;
}

/* Variants */
.toast.success {
    border-left-color: #10b981;
}

.toast.success i {
    color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.error i {
    color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast.warning i {
    color: #f59e0b;
}