/* ============================================
   GMRAV Systems — Admin Styles
   Compact, functional, Notion/Linear-inspired
   ============================================ */

/* --- Admin Login --- */
.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-lg);
}

.admin-login-box {
    width: 100%;
    max-width: 380px;
}

.admin-login-box h1 {
    font-size: var(--fs-xl);
    margin-bottom: var(--sp-xs);
}

.admin-login-box p {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-bottom: var(--sp-xl);
}

.admin-login-box label {
    font-size: var(--fs-sm);
    font-weight: 500;
    display: block;
    margin-bottom: 6px;
}

.admin-login-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    margin-bottom: var(--sp-lg);
    outline: none;
    transition: border-color 0.2s ease;
}

.admin-login-box input:focus {
    border-color: var(--accent);
}

.login-error {
    font-size: var(--fs-sm);
    color: #c0392b;
    margin: -8px 0 var(--sp-md);
}

/* --- Admin Top Bar --- */
.admin-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
    z-index: 100;
}

.admin-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.admin-bar-brand {
    font-weight: 600;
    font-size: var(--fs-sm);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-bar-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-lg);
}

.admin-tab {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-muted);
    padding-bottom: 4px;
    border-bottom: 1.5px solid transparent;
    transition: all 0.2s ease;
}

.admin-tab:hover {
    color: var(--text);
}

.admin-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.admin-logout {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.admin-logout:hover {
    color: #c0392b;
}

/* --- Admin Main --- */
.admin-main {
    padding: calc(var(--nav-h) + var(--sp-2xl)) 0 var(--sp-4xl);
}

.admin-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-xl);
}

.admin-panel-header h2 {
    font-size: var(--fs-lg);
}

.btn-sm {
    padding: 8px 18px;
    font-size: var(--fs-xs);
}

/* --- Admin Table --- */
.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.admin-table th {
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: var(--sp-sm) var(--sp-md);
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: var(--sp-md);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: var(--bg-alt);
}

.table-empty {
    text-align: center;
    color: var(--text-muted);
    padding: var(--sp-2xl) !important;
}

.table-actions {
    display: flex;
    gap: var(--sp-md);
}

.table-actions a,
.table-actions button {
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: color 0.2s ease;
}

.table-action-edit {
    color: var(--accent);
}

.table-action-edit:hover {
    color: var(--accent-hover);
}

.table-action-delete {
    color: var(--text-muted);
}

.table-action-delete:hover {
    color: #c0392b;
}

/* --- Admin Form --- */
.admin-form {
    max-width: 560px;
}

.admin-form label {
    font-size: var(--fs-sm);
    font-weight: 500;
    display: block;
    margin-bottom: 6px;
    margin-top: var(--sp-lg);
}

.admin-form label:first-of-type {
    margin-top: var(--sp-xl);
}

.admin-form input,
.admin-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    outline: none;
    transition: border-color 0.2s ease;
}

.admin-form input:focus,
.admin-form textarea:focus {
    border-color: var(--accent);
}

.admin-form textarea {
    resize: vertical;
    min-height: 100px;
}

.admin-form-actions {
    display: flex;
    gap: var(--sp-md);
    margin-top: var(--sp-xl);
}

/* --- Drop Zone --- */
.upload-section {
    margin-top: var(--sp-3xl);
    padding-top: var(--sp-2xl);
    border-top: 1px solid var(--border-light);
}

.upload-section h3 {
    font-size: var(--fs-lg);
    margin-bottom: var(--sp-lg);
}

.drop-zone {
    border: 1.5px dashed var(--border);
    padding: var(--sp-3xl) var(--sp-xl);
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(184, 92, 56, 0.04);
}

.drop-zone-icon {
    display: block;
    font-size: var(--fs-xl);
    color: var(--text-muted);
    margin-bottom: var(--sp-sm);
}

.drop-zone-text {
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

.drop-zone-browse {
    color: var(--accent);
    cursor: pointer;
    font-weight: 500;
}

.drop-zone-browse:hover {
    color: var(--accent-hover);
}

/* --- Upload Progress --- */
.upload-progress-list {
    margin-top: var(--sp-lg);
}

.upload-progress-item {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    padding: var(--sp-sm) 0;
    font-size: var(--fs-sm);
    border-bottom: 1px solid var(--border-light);
}

.upload-progress-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-progress-bar {
    width: 120px;
    height: 4px;
    background: var(--bg-alt);
    overflow: hidden;
}

.upload-progress-bar-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.upload-progress-status {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    min-width: 60px;
    text-align: right;
}

/* --- Uploaded Photos Grid --- */
.uploaded-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--sp-sm);
    margin-top: var(--sp-xl);
}

.uploaded-photo-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.uploaded-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uploaded-photo-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.uploaded-photo-item:hover .uploaded-photo-delete {
    opacity: 1;
}

/* --- Usage Dashboard --- */
.usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--sp-lg);
    margin-top: var(--sp-xl);
}

.usage-card {
    padding: var(--sp-lg);
    border: 1px solid var(--border-light);
    background: var(--surface);
}

.usage-card-label {
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: var(--sp-sm);
}

.usage-card-value {
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    margin-bottom: var(--sp-md);
}

.usage-bar {
    height: 6px;
    background: var(--bg-alt);
    overflow: hidden;
    margin-bottom: var(--sp-sm);
}

.usage-bar-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.usage-card-pct {
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

.usage-plan-label {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-top: var(--sp-xl);
    padding-top: var(--sp-lg);
    border-top: 1px solid var(--border-light);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .admin-bar-nav {
        gap: var(--sp-md);
    }

    .admin-panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--sp-md);
    }

    .uploaded-photos {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .usage-grid {
        grid-template-columns: 1fr;
    }
}