/* ========================================
   Common Styles — CheerAI Admin
   ======================================== */

:root {
    --primary: #1e293b;
    --primary-light: #334155;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #22c55e;
    --success-hover: #16a34a;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --text: #1e293b;
    --text-secondary: #64748b;
    --bg: #f1f5f9;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-sm: 6px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
}

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

a:hover {
    color: var(--accent-hover);
}

/* ---- Top Navigation Bar ---- */
.top-nav {
    background: var(--primary);
    padding: 0 24px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.top-nav .nav-brand {
    font-weight: 700;
    font-size: 15px;
    color: var(--white);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.top-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
}

.top-nav .nav-links a,
.top-nav .nav-links span {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.top-nav .nav-links a:hover {
    color: var(--white);
    background: rgba(255,255,255,0.1);
}

.top-nav .nav-links span.active {
    color: var(--white);
    background: rgba(255,255,255,0.15);
    font-weight: 600;
}

.top-nav .nav-links .nav-sep {
    color: rgba(255,255,255,0.2);
    padding: 0 2px;
    font-size: 12px;
}

/* ---- Nav Dropdown ---- */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown > a {
    cursor: pointer;
}

.nav-dropdown .nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--primary);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1001;
    padding: 4px 0;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown .nav-dropdown-menu a {
    display: block;
    padding: 8px 16px !important;
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    white-space: nowrap;
    border-radius: 0 !important;
}

.nav-dropdown .nav-dropdown-menu a:hover {
    color: var(--white);
    background: rgba(255,255,255,0.1);
}

.top-nav .nav-links a.nav-logout {
    color: rgba(255,255,255,0.55);
    margin-left: 12px;
    border-left: 1px solid rgba(255,255,255,0.15);
    border-radius: 0 4px 4px 0;
    padding-left: 16px;
}

.top-nav .nav-links a.nav-logout:hover {
    color: #fca5a5;
    background: rgba(239,68,68,0.12);
}

/* ---- Page Layout ---- */
.page-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 32px 12px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 4px;
}

.page-header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 14px;
}

.page-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px 40px;
}

/* ---- Card ---- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* ---- Buttons ---- */
.btn {
    padding: 9px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 2px 6px rgba(59,130,246,0.3);
}

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

.btn-success:hover {
    background: var(--success-hover);
    box-shadow: 0 2px 6px rgba(34,197,94,0.3);
}

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

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---- Dashboard Grid ---- */
.func-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 8px;
}

.func-grid a {
    text-decoration: none;
}

.func-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 16px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.func-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    color: var(--accent);
}

.section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

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

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* ---- Tables ---- */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--white);
}

.data-table thead {
    background: var(--primary);
    color: var(--white);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

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

.data-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.data-table tbody tr:nth-child(even):hover {
    background: #f1f5f9;
}

/* ---- Form Elements ---- */
.form-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* ---- Upload Area ---- */
.upload-area {
    text-align: center;
    padding: 32px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: #f8fafc;
    transition: border-color 0.2s;
}

.upload-area:hover {
    border-color: var(--accent);
}

/* ---- Utility ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px; }
.font-bold { font-weight: 600; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }

