/* ==========================================================================
   Insektenwiese Admin Backend
   ========================================================================== */

:root {
    --color-forest: #2D5A27;
    --color-leaf:   #4ADE80;
    --color-beige:  #F5F5F0;
    --color-sand:   #E8E2D2;
    --color-sun:    #F59E0B;
    --color-earth:  #374151;
    --color-bg:     #F8FAFC;
    --color-border: #E2E8F0;
}

body.admin {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-earth);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: linear-gradient(180deg, var(--color-forest) 0%, #1F3D1C 100%);
    color: white;
    overflow-y: auto;
    z-index: 50;
}

.admin-sidebar__brand {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-sidebar__brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--color-leaf);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.admin-sidebar__brand-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 18px;
}

.admin-sidebar__brand-text small {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-sidebar__nav {
    padding: 16px 12px;
}

.admin-sidebar__group-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 16px 12px 8px;
}

.admin-sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,0.75);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.admin-sidebar__link i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.admin-sidebar__link:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.admin-sidebar__link.is-active {
    background: var(--color-leaf);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

/* ==========================================================================
   Main Content
   ========================================================================== */
.admin-main {
    margin-left: 260px;
    min-height: 100vh;
}

.admin-topbar {
    background: white;
    border-bottom: 1px solid var(--color-border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
}

.admin-topbar__title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--color-forest);
}

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

.admin-topbar__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-forest), var(--color-leaf));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.admin-content {
    padding: 32px;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.admin-card {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

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

.admin-card__title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--color-forest);
}

.admin-card__body {
    padding: 24px;
}

/* ==========================================================================
   Stats
   ========================================================================== */
.admin-stat {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.2s ease;
}

.admin-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.06);
}

.admin-stat__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    margin-bottom: 16px;
}

.admin-stat__value {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: var(--color-earth);
    line-height: 1;
    margin-bottom: 4px;
}

.admin-stat__label {
    font-size: 13px;
    color: rgba(55, 65, 81, 0.6);
    font-weight: 500;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.admin-form-group {
    margin-bottom: 20px;
}

.admin-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-earth);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-input,
.admin-select,
.admin-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--color-earth);
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
    outline: none;
    border-color: var(--color-forest);
    box-shadow: 0 0 0 4px rgba(45, 90, 39, 0.1);
}

.admin-textarea {
    min-height: 100px;
    resize: vertical;
    font-family: 'Inter', sans-serif;
}

.admin-textarea--code {
    font-family: 'Courier New', monospace;
    min-height: 240px;
}

.admin-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.admin-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--color-forest);
}

.admin-help {
    font-size: 12px;
    color: rgba(55,65,81,0.6);
    margin-top: 6px;
}

.admin-error {
    font-size: 12px;
    color: #EF4444;
    margin-top: 6px;
    font-weight: 500;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn--primary {
    background: var(--color-forest);
    color: white;
    box-shadow: 0 4px 12px rgba(45,90,39,0.2);
}

.btn--primary:hover {
    background: #1F3D1C;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(45,90,39,0.25);
}

.btn--secondary {
    background: white;
    color: var(--color-earth);
    border: 1.5px solid var(--color-border);
}

.btn--secondary:hover {
    border-color: var(--color-forest);
    color: var(--color-forest);
}

.btn--danger {
    background: #FEE2E2;
    color: #DC2626;
}

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

.btn--sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    padding: 12px 16px;
    background: #F8FAFC;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: rgba(55,65,81,0.7);
    border-bottom: 1px solid var(--color-border);
}

.admin-table td {
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}

.admin-table tr:hover td {
    background: #F8FAFC;
}

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

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge--draft     { background: #FEF3C7; color: #92400E; }
.badge--published { background: #D1FAE5; color: #065F46; }
.badge--archived  { background: #E5E7EB; color: #374151; }
.badge--pending   { background: #FEE2E2; color: #991B1B; }
.badge--approved  { background: #D1FAE5; color: #065F46; }

/* ==========================================================================
   Flash
   ========================================================================== */
.admin-flash {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-weight: 500;
    border: 1px solid transparent;
}

.admin-flash--success {
    background: #ECFDF5;
    color: #065F46;
    border-color: #A7F3D0;
}

.admin-flash--error {
    background: #FEF2F2;
    color: #991B1B;
    border-color: #FECACA;
}

/* ==========================================================================
   Login
   ========================================================================== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E8F3E8 0%, #F5F5F0 50%, #E8E2D2 100%);
    padding: 24px;
}

.login-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.1);
    padding: 48px;
    width: 100%;
    max-width: 440px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.login-logo__icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--color-forest), var(--color-leaf));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* ==========================================================================
   Media Library / Drag & Drop Upload
   ========================================================================== */
.upload-dropzone {
    border: 2.5px dashed var(--color-border);
    border-radius: 16px;
    padding: 60px 24px;
    text-align: center;
    background: #F8FAFC;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
    border-color: var(--color-forest);
    background: rgba(45, 90, 39, 0.04);
    transform: scale(1.005);
}

.upload-dropzone__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--color-forest), var(--color-leaf));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.upload-dropzone__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-forest);
    margin-bottom: 4px;
}

.upload-dropzone__subtitle {
    color: rgba(55,65,81,0.6);
    font-size: 14px;
}

.upload-progress {
    margin-top: 16px;
    height: 8px;
    background: #E2E8F0;
    border-radius: 999px;
    overflow: hidden;
}

.upload-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-forest), var(--color-leaf));
    width: 0%;
    transition: width 0.2s ease;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.media-tile {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
}

.media-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.media-tile__img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    background: #F8FAFC;
}

.media-tile__body {
    padding: 12px;
}

.media-tile__name {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-earth);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-tile__meta {
    font-size: 11px;
    color: rgba(55,65,81,0.5);
    margin-top: 2px;
}

.media-tile__actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.media-tile:hover .media-tile__actions {
    opacity: 1;
}

.media-tile__btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.95);
    border: none;
    cursor: pointer;
    color: var(--color-earth);
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.media-tile__btn:hover {
    background: white;
    color: var(--color-forest);
    transform: scale(1.1);
}

.media-tile__btn--danger:hover {
    color: #DC2626;
}

.upload-list {
    margin-top: 16px;
}

.upload-list__item {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.upload-list__item--success {
    border-color: var(--color-leaf);
    background: #ECFDF5;
}

.upload-list__item--error {
    border-color: #FECACA;
    background: #FEF2F2;
    color: #991B1B;
}
