/* ============================================================
   Admin Panel & Login — adrianmalik.pl
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --am-sidebar-width: 240px;
    --am-sidebar-bg: #0f172a;
    --am-sidebar-hover: #1e293b;
    --am-sidebar-active: #2563eb;
    --am-sidebar-text: #94a3b8;
    --am-sidebar-text-active: #f8fafc;
    --am-content-bg: #f8fafc;
    --am-card-bg: #ffffff;
    --am-border: #e2e8f0;
    --am-text: #1e293b;
    --am-text-muted: #64748b;
    --am-radius: 8px;
    --am-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --am-shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.am-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    padding: 1rem;
}

.am-login-card {
    background: var(--am-card-bg);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.am-login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.am-login-label {
    color: var(--am-text-muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: .25rem;
}

.am-login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--am-text);
    margin: 0;
}

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.am-admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--am-content-bg);
}

/* --- Sidebar --- */
.am-admin-sidebar {
    width: var(--am-sidebar-width);
    background: var(--am-sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.am-admin-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #1e293b;
}

.am-admin-brand-icon {
    font-size: 1.2rem;
}

.am-admin-brand-text {
    font-size: .85rem;
    font-weight: 600;
    color: var(--am-sidebar-text-active);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.am-admin-nav {
    list-style: none;
    padding: .5rem 0;
    margin: 0;
    flex: 1;
}

.am-admin-nav-section {
    padding: .75rem 1rem .25rem;
    font-size: .65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #475569;
}

.am-admin-nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem 1rem;
    color: var(--am-sidebar-text);
    text-decoration: none;
    font-size: .875rem;
    border-radius: 0;
    transition: background .15s, color .15s;
    cursor: pointer;
}

.am-admin-nav-link:hover {
    background: var(--am-sidebar-hover);
    color: var(--am-sidebar-text-active);
    text-decoration: none;
}

.am-admin-nav-link.active {
    background: var(--am-sidebar-active);
    color: #fff;
}

.am-admin-nav-icon {
    width: 1.2rem;
    text-align: center;
    font-size: .95rem;
}

.am-admin-sidebar-footer {
    padding: .5rem 0;
    border-top: 1px solid #1e293b;
}

.am-admin-logout {
    color: #ef4444 !important;
}

.am-admin-logout:hover {
    background: rgba(239,68,68,.1) !important;
}

/* --- Main content --- */
.am-admin-main {
    margin-left: var(--am-sidebar-width);
    flex: 1;
    min-width: 0;
}

.am-admin-content {
    padding: 2rem;
    max-width: 1200px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.am-admin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.am-admin-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--am-text);
    margin: 0;
}

.am-admin-page-subtitle {
    color: var(--am-text-muted);
    font-size: .875rem;
    margin: .2rem 0 0;
}

.am-admin-section-title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--am-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .5rem;
}

/* ============================================================
   DASHBOARD STATS
   ============================================================ */
.am-admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.am-admin-stat-card {
    background: var(--am-card-bg);
    border: 1px solid var(--am-border);
    border-radius: var(--am-radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--am-shadow);
    transition: box-shadow .15s;
}

.am-admin-stat-card:hover {
    box-shadow: var(--am-shadow-md);
}

.am-admin-stat-icon {
    font-size: 1.75rem;
    margin-bottom: .5rem;
}

.am-admin-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--am-text);
    line-height: 1;
}

.am-admin-stat-label {
    font-size: .8rem;
    color: var(--am-text-muted);
    margin: .3rem 0 .6rem;
}

.am-admin-stat-link {
    font-size: .75rem;
    color: #2563eb;
    text-decoration: none;
}

.am-admin-stat-link:hover {
    text-decoration: underline;
}

/* ============================================================
   TABLES
   ============================================================ */
.am-admin-table-wrap {
    background: var(--am-card-bg);
    border: 1px solid var(--am-border);
    border-radius: var(--am-radius);
    overflow: hidden;
    box-shadow: var(--am-shadow);
    margin-bottom: 1rem;
}

.am-admin-table {
    margin: 0 !important;
    font-size: .875rem;
}

.am-admin-table thead th {
    background: #f1f5f9;
    color: var(--am-text-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
    border-bottom: 1px solid var(--am-border) !important;
    padding: .75rem 1rem;
}

.am-admin-table td {
    vertical-align: middle;
    padding: .75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.am-admin-table tbody tr:last-child td {
    border-bottom: none;
}

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

/* ============================================================
   FORMS
   ============================================================ */
.am-admin-form {
    background: var(--am-card-bg);
    border: 1px solid var(--am-border);
    border-radius: var(--am-radius);
    padding: 1.5rem;
    box-shadow: var(--am-shadow);
}

.am-admin-img-preview {
    max-height: 80px;
    border-radius: 4px;
    border: 1px solid var(--am-border);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.am-admin-empty {
    background: var(--am-card-bg);
    border: 2px dashed var(--am-border);
    border-radius: var(--am-radius);
    padding: 3rem;
    text-align: center;
    color: var(--am-text-muted);
}

/* ============================================================
   MODAL OVERLAY
   ============================================================ */
.am-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.am-modal {
    background: #fff;
    border-radius: var(--am-radius);
    padding: 1.5rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0,0,0,.2);
}

.am-modal h5 {
    margin-bottom: .75rem;
    font-weight: 600;
}

/* ============================================================
   SKILL STARS
   ============================================================ */
.am-skill-stars {
    font-size: 1.1rem;
    letter-spacing: .1em;
}

.am-skill-stars .filled { color: #f59e0b; }
.am-skill-stars .empty  { color: #e2e8f0; }

/* ============================================================
   CERTIFICATE GRID (Admin)
   ============================================================ */
.am-admin-cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.am-admin-cert-card {
    background: var(--am-card-bg);
    border: 1px solid var(--am-border);
    border-radius: var(--am-radius);
    overflow: hidden;
    box-shadow: var(--am-shadow);
    display: flex;
    flex-direction: column;
}

.am-admin-cert-thumb {
    width: 100%;
    height: 130px;
    object-fit: cover;
}

.am-admin-cert-placeholder {
    width: 100%;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: #f1f5f9;
}

.am-admin-cert-info {
    padding: .75rem;
    flex: 1;
    font-size: .85rem;
}

.am-admin-cert-actions {
    padding: .5rem .75rem;
    border-top: 1px solid var(--am-border);
    display: flex;
    gap: .4rem;
}

/* ============================================================
   AVATAR CROP MODAL
   ============================================================ */

/* Kontener na Croppera w modal-body */
.am-crop-body {
    max-height: 60vh;
    overflow: hidden;
    background: #111;
}

/* Okrągłe koło w crop-boxie Cropper.js */
.am-crop-body .cropper-view-box,
.am-crop-body .cropper-face {
    border-radius: 50%;
}

.am-crop-body .cropper-view-box {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75);
    outline: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .am-admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .am-admin-main {
        margin-left: 0;
    }

    .am-admin-layout {
        flex-direction: column;
    }

    .am-admin-content {
        padding: 1rem;
    }

    .am-admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
