/*
   Kisii University Vice Chancellor Portal
   Admin Dashboard specific CSS Stylesheet
*/

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

:root {
    --admin-sidebar-bg: #1e293b;
    --admin-sidebar-hover: #334155;
    --admin-primary: #0b3c5d;
    --admin-secondary: #f5b041;
    --admin-text-dark: #0f172a;
    --admin-bg-light: #f8fafc;
    --admin-border: #e2e8f0;
    --admin-success: #10b981;
    --admin-danger: #ef4444;
    --admin-warning: #f59e0b;
    --font-sans: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--admin-text-dark);
    background-color: var(--admin-bg-light);
    display: flex;
    min-height: 100vh;
}

/* Auth Layout */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0b3c5d 0%, #061726 100%);
    padding: 1.5rem;
}

.auth-card {
    background-color: #ffffff;
    padding: 2.5rem;
    border-radius: 8px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

.auth-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--admin-primary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.auth-logo-mark {
    width: 76px;
    height: 76px;
    margin: 0 auto 1rem auto;
    padding: 0.45rem;
    border-radius: 12px;
    border: 1px solid var(--admin-border);
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(11, 60, 93, 0.12);
}

.auth-logo-mark img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.auth-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 2rem;
    font-weight: 500;
}

.auth-form {
    text-align: left;
}

/* Panel Layout */
.admin-sidebar {
    width: 260px;
    background-color: var(--admin-sidebar-bg);
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #334155;
    text-align: center;
}

.sidebar-logo {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-logo span {
    color: var(--admin-secondary);
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.sidebar-logo-mark {
    background: #ffffff;
    border-radius: 10px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem auto;
    padding: 0.35rem;
    box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

.sidebar-logo-mark img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    gap: 0.75rem;
}

.sidebar-menu a:hover,
.sidebar-menu li.active a {
    color: #ffffff;
    background-color: var(--admin-sidebar-hover);
}

.sidebar-menu li.active a {
    border-left: 4px solid var(--admin-secondary);
    padding-left: calc(1.5rem - 4px);
}

.sidebar-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #334155;
    font-size: 0.8rem;
}

.admin-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.admin-header {
    height: 70px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.admin-header-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.admin-user {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--admin-primary);
}

.admin-content {
    padding: 2rem;
    flex-grow: 1;
    overflow-y: auto;
}

/* Dashboard Widgets */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--admin-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-details h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--admin-primary);
    margin-bottom: 0.25rem;
}

.stat-details p {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #f1f5f9;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.35rem;
    color: var(--admin-primary);
}

.stat-icon.primary { background-color: rgba(11, 60, 93, 0.1); color: var(--admin-primary); }
.stat-icon.warning { background-color: rgba(245, 176, 65, 0.1); color: #d97706; }
.stat-icon.success { background-color: rgba(16, 185, 129, 0.1); color: var(--admin-success); }
.stat-icon.danger { background-color: rgba(239, 68, 68, 0.1); color: var(--admin-danger); }

/* Panels and Cards */
.admin-card {
    background-color: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    margin-bottom: 2rem;
}

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

.admin-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--admin-primary);
}

.admin-card-body {
    padding: 1.5rem;
}

/* Forms & UI Controls */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: #334155;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    background-color: #ffffff;
    color: var(--admin-text-dark);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 2px rgba(11, 60, 93, 0.15);
}

textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    border-top: 1px solid var(--admin-border);
    padding-top: 1.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.25rem;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    text-decoration: none;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background-color: #082d46;
}

.btn-secondary {
    background-color: #64748b;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-success {
    background-color: var(--admin-success);
    color: #ffffff;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--admin-danger);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 3px;
}

/* Tables */
.admin-table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.admin-table th {
    background-color: #f1f5f9;
    padding: 0.85rem 1rem;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid var(--admin-border);
}

.admin-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--admin-border);
    color: #334155;
    vertical-align: middle;
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background-color: #d1fae5; color: #065f46; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-danger { background-color: #fee2e2; color: #991b1b; }
.badge-info { background-color: #e0f2fe; color: #075985; }

/* Dashboard Columns */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
}

/* Image previewer */
.image-preview-box {
    width: 120px;
    height: 120px;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 0.5rem;
    background-color: #f1f5f9;
}

.image-preview-box.has-smart-preview {
    position: relative;
    background:
        linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
        linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
    background-color: #f8fafc;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-size: 20px 20px;
}

.image-preview-box.has-multiple-preview {
    padding: 0.75rem;
}

.multi-image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 0.5rem;
    width: 100%;
    height: calc(100% - 2rem);
    overflow: auto;
}

.multi-image-preview-grid img,
.multi-image-preview-more {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 5px;
    object-fit: cover;
    background-color: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.15);
}

.multi-image-preview-more {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background-color: rgba(15, 23, 42, 0.78);
    font-weight: 800;
}

.image-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-box img.smart-preview-image {
    object-fit: contain;
    background-color: rgba(255,255,255,0.72);
}

.image-preview-meta {
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    background-color: rgba(15, 23, 42, 0.78);
    color: #ffffff;
    font-size: 0.72rem;
    line-height: 1.2;
    text-align: center;
    pointer-events: none;
}

.logo-preview-box {
    width: 150px;
    height: 110px;
    padding: 0.5rem;
    background-color: #ffffff;
}

.logo-preview-box img {
    object-fit: contain;
}

.page-photo-preview {
    width: 100%;
    height: 240px;
    background-color: #eef2f7;
}

.page-photo-preview img,
.portrait-preview-box img {
    object-fit: contain;
    background-color: #eef2f7;
}

.social-icon-preview-box {
    width: 56px;
    height: 56px;
    padding: 0.55rem;
    background-color: #0b1d2d;
}

.social-icon-preview-box img {
    object-fit: contain;
}

.social-account-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 0.9rem;
}

.social-account-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 0.8rem;
    padding: 0.85rem;
    border: 1px solid #dbe4ee;
    border-radius: 6px;
    background-color: #f8fafc;
}

.social-account-fields label,
.social-account-icon-cell label {
    margin-top: 0;
}

.social-account-fields input + label {
    margin-top: 0.65rem;
}

.social-account-icon-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
}

.social-account-icon-cell .paste-image-target-small {
    margin-top: 0;
}

.social-account-icon-cell .social-icon-preview-box {
    margin-top: 0;
}

.remove-social-account {
    width: 100%;
}

.paste-image-target {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 38px;
    margin-top: 0.55rem;
    padding: 0.55rem 0.75rem;
    border: 1px dashed var(--admin-primary);
    border-radius: 6px;
    background-color: #f8fafc;
    color: var(--admin-primary);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: text;
}

.paste-image-target:focus {
    outline: none;
    border-style: solid;
    box-shadow: 0 0 0 2px rgba(11, 60, 93, 0.15);
    background-color: #ffffff;
}

.paste-image-target-small {
    width: auto;
    min-height: 30px;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
}

.gallery-image-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
    gap: 0.5rem;
    max-height: 172px;
    overflow: auto;
    padding: 0.55rem;
    margin-top: 0.35rem;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    background-color: #f8fafc;
}

.gallery-image-choice {
    position: relative;
    display: block;
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background-color: #ffffff;
}

.gallery-image-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gallery-image-choice img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background-color: #ffffff;
}

.gallery-image-choice:has(input:checked) {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 2px rgba(11, 60, 93, 0.16);
}

.gallery-image-choice-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem;
    text-align: center;
    font-size: 0.7rem;
    line-height: 1.2;
    color: #475569;
    border-style: dashed;
}

.landing-template-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.landing-template-option {
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.18s ease;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.landing-template-option:hover,
.landing-template-option.selected {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 2px rgba(11, 60, 93, 0.12);
}

.landing-template-option input {
    width: auto;
}

.landing-template-option strong {
    color: var(--admin-primary);
}

.landing-template-option small {
    color: #64748b;
    line-height: 1.45;
}

.landing-template-preview {
    height: 140px;
    border-radius: 6px;
    border: 1px solid var(--admin-border);
    background-color: #f8fafc;
    position: relative;
    overflow: hidden;
    display: block;
}

.classic-preview {
    background: linear-gradient(135deg, #0b3c5d 0%, #062235 100%);
}

.classic-preview span:nth-child(1) {
    position: absolute;
    left: 1rem;
    top: 2rem;
    width: 45%;
    height: 12px;
    background-color: #ffffff;
    border-radius: 2px;
}

.classic-preview span:nth-child(2) {
    position: absolute;
    left: 1rem;
    top: 3.4rem;
    width: 34%;
    height: 8px;
    background-color: #cbd5e1;
    border-radius: 2px;
}

.classic-preview span:nth-child(3) {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    width: 32%;
    height: 88px;
    background-color: #dbeafe;
    border-radius: 6px;
}

.executive-preview {
    background-color: #f1f2f6;
}

.executive-preview span:nth-child(1) {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 26px;
    background-color: #233f91;
}

.executive-preview span:nth-child(2) {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 48px;
    height: 48px;
    transform: translateX(-50%);
    border-radius: 50%;
    background-color: #ffffff;
    border: 4px solid #f8fafc;
}

.executive-preview span:nth-child(3) {
    position: absolute;
    left: 1rem;
    bottom: 0;
    width: 34%;
    height: 82px;
    background-color: #bfdbfe;
    border-radius: 5px 5px 0 0;
}

/* Alert States */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

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

/* Responsiveness */
@media (max-width: 1024px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    .social-account-row {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        width: 100%;
        height: auto;
    }
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    .landing-template-grid {
        grid-template-columns: 1fr;
    }
}
