/* ==========================================
   AGENCY DASHBOARD (ELITE WORKSPACE UI)
   ========================================== */

/* --- LAYOUT ENGINE --- */
.dash-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: #fcfcfc; /* Matched global off-white */
    padding-top: var(--header-height, 100px); 
    font-family: var(--font-sans);
}

/* --- THE CRYSTAL SIDEBAR --- */
.dash-sidebar {
    width: 280px;
    background: #ffffff; 
    padding: 30px 20px;
    flex-shrink: 0;
    border-right: 1px solid #eaeaea; 
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.sidebar-brand-area {
    padding: 0 15px 30px;
    margin-bottom: 20px;
    border-bottom: 1px solid #1a1a1a; /* Sharper dividing line */
}

.workspace-label {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: #1a1a1a;
}

.dash-nav {
    display: flex;
    flex-direction: column;
    gap: 4px; /* Tighter, more serious spacing */
}

/* Nav Items: Editorial Sharp */
.dash-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: #888888; 
    text-decoration: none;
    font-size: 13px;
    font-weight: 600; 
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 0; /* Sharp corners */
    transition: all 0.3s ease;
    position: relative;
    border-left: 2px solid transparent;
}

.dash-nav-item svg {
    color: #888888;
    transition: color 0.3s ease;
}

/* Hover & Active States */
.dash-nav-item:hover {
    color: #1a1a1a;
    border-left-color: #cccccc;
}
.dash-nav-item:hover svg { color: #1a1a1a; }

.dash-nav-item.active {
    background-color: #fafafa; 
    color: #1a1a1a; 
    border-left-color: #1a1a1a; /* Strong black anchor line */
}
.dash-nav-item.active svg { color: #1a1a1a; }

/* Badges */
.nav-badge {
    background: #1a1a1a; /* Black instead of Red */
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 0;
    margin-left: auto; 
}

.badge-soon {
    background: transparent;
    color: #888888;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 2px 6px;
    border: 1px solid #cccccc;
    margin-left: auto;
}

.disabled-nav {
    opacity: 0.4;
    cursor: default;
}
.disabled-nav:hover { border-left-color: transparent; color: #888888; }

.nav-divider {
    height: 1px;
    background: #eaeaea;
    margin: 15px 0;
}

.logout-link {
    margin-top: auto; 
    color: #1a1a1a;
}
.logout-link svg { color: #1a1a1a; }
.logout-link:hover { border-left-color: #1a1a1a; }

/* --- CONTENT AREA --- */
.dash-content {
    flex: 1;
    padding: 50px 60px;
    overflow-y: auto;
}

.dash-page-header {
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 20px;
}

.dash-heading {
    font-family: var(--font-serif);
    font-size: 36px;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    font-weight: 400;
    letter-spacing: -0.02em;
}

.dash-subheading {
    font-family: var(--font-sans);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #888888;
    margin: 0;
}

/* --- ALERTS --- */
.dash-alert {
    padding: 16px 24px;
    margin-bottom: 30px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 0; /* Sharp corners */
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.alert-success { background: #ffffff; color: #1a1a1a; border: 1px solid #1a1a1a; border-left: 4px solid #1a1a1a; }
.alert-error { background: #ffffff; color: #1a1a1a; border: 1px solid #cccccc; border-left: 4px solid #1a1a1a; }

/* ==========================================
   THE CARD UI
   ========================================== */
.card-style {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 0; /* Sharp corners */
    box-shadow: none; /* Removed shadow */
}

/* --- METRICS ROW --- */
.dash-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 50px;
}

.metric-card {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-top: 2px solid #1a1a1a; 
    border-radius: 0; 
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    box-shadow: none; 
    transition: border-color 0.3s ease;
}

.metric-card:hover {
    border-color: #1a1a1a; /* Hover goes solid black */
}

.metric-icon {
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-data {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.metric-label {
    font-family: var(--font-sans);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: #888888;
    font-weight: 700;
    margin-bottom: 10px;
}

/* FIX: Swapped to Sans-Serif to fix the "vampire" numbers */
.metric-val {
    font-family: var(--font-sans); /* Changed from serif to sans */
    font-weight: 300; /* Lighter weight for elegance */
    font-size: 36px; /* Slightly smaller since sans is wider */
    color: #1a1a1a;
    line-height: 1;
    letter-spacing: -0.05em; /* Pulls the numbers tight */
}

/* --- DATA TABLES --- */
.table-responsive { overflow: hidden; margin-bottom: 30px; }

.dash-table {
    width: 100%;
    border-collapse: collapse;
}

.dash-table th {
    background: #ffffff;
    text-align: left;
    padding: 20px 30px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #1a1a1a;
    font-weight: 700;
    border-bottom: 2px solid #1a1a1a; /* Strong header anchor */
}

.dash-table td {
    padding: 20px 30px;
    border-bottom: 1px solid #eaeaea;
    font-size: 14px;
    color: #444444;
    vertical-align: middle;
}

.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background-color: #fafafa; }

/* FIX: Table text is strictly sans-serif for numbers/data */
.table-main-text { font-family: var(--font-sans); color: #1a1a1a; font-weight: 600; font-size: 15px; }
.table-bold-text { font-family: var(--font-sans); color: #1a1a1a; font-weight: 600; font-size: 15px; letter-spacing: -0.02em; }

.dash-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 0; }
.dash-thumb-placeholder { width: 56px; height: 56px; background: #f0f0f0; border-radius: 0; }

.dash-meta-text { font-family: var(--font-sans); font-size: 12px; color: #888888; display: block; margin-top: 4px; }
.dash-link { font-family: var(--font-sans); color: #1a1a1a; font-weight: 600; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s ease;}
.dash-action-link { font-family: var(--font-sans); color: #1a1a1a; font-weight: 600; text-decoration: none; border-bottom: 1px solid #1a1a1a; }
.dash-link:hover { border-bottom-color: #1a1a1a; }
.dash-action-link:hover { border-bottom-color: transparent; }
.dash-msg-preview { max-width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #666; }

.text-right { text-align: right !important; }

/* Empty States */
.table-empty-state { text-align: center; padding: 80px 20px !important; }
.empty-state-content { display: flex; flex-direction: column; align-items: center; justify-content: center; color: #888; }
.empty-state-content svg { color: #1a1a1a; margin-bottom: 15px; }
.empty-state-content h3 { font-family: var(--font-serif); font-size: 24px; color: #1a1a1a; margin: 0 0 10px 0; }
.empty-state-content p { margin: 0; font-size: 15px; }

/* --- STATUS BADGES (Sharp Edges) --- */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid currentColor;
}
.status-badge.publish { color: #1a1a1a; background: transparent; }
.status-badge.pending { color: #888888; background: transparent; }
.status-badge.draft { color: #cccccc; background: transparent; border-color: #eaeaea; }

/* --- TABLE ACTIONS --- */
.action-btn {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    margin-left: 15px;
    transition: opacity 0.3s ease;
    color: #1a1a1a;
}
.btn-delete { color: #1a1a1a; border-bottom: 1px solid currentColor; }
.action-btn:hover { opacity: 0.5; }

/* ==========================================
   FORMS & INPUTS (Editorial Style)
   ========================================== */
.form-panel { padding: 0; overflow: hidden; }
.form-section { padding: 40px; }

.section-title {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 30px;
    color: #1a1a1a;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 15px;
}

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.form-group { margin-bottom: 30px; }

.form-group label {
    display: block;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.dash-input {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    padding: 15px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #d4d4d4;
    border-radius: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.4s ease;
}

.dash-input:focus {
    border-bottom-color: #1a1a1a;
}

textarea.dash-input { resize: vertical; }

/* --- DROPZONE & IMAGES --- */
.dropzone {
    border: 1px solid #cccccc;
    border-radius: 0;
    padding: 40px 20px;
    text-align: center;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dropzone:hover, .dropzone.dragover {
    border-color: #1a1a1a;
    background: #fafafa;
}

.dropzone-icon { color: #1a1a1a; margin-bottom: 10px; display: inline-block;}
.dropzone-text { font-family: var(--font-sans); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: #1a1a1a; display: block; }

.image-preview-grid { display: flex; gap: 15px; flex-wrap: wrap; margin-top: 20px; }

.preview-thumb {
    position: relative;
    width: 120px;
    height: 120px;
    background: #f0f0f0;
    border-radius: 0;
    overflow: hidden;
}

.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview-thumb.uploading span { font-size: 11px; font-weight: 600; color: #888; position: absolute; top:50%; left:50%; transform: translate(-50%,-50%); }

.delete-img-btn {
    position: absolute;
    top: 6px; right: 6px;
    width: 26px; height: 26px;
    background: #ffffff; color: #1a1a1a;
    border: 1px solid #1a1a1a; border-radius: 0;
    font-size: 16px; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0; transform: scale(0.8);
    transition: all 0.2s ease;
}

.preview-thumb:hover .delete-img-btn { opacity: 1; transform: scale(1); }
.delete-img-btn:hover { background: #1a1a1a; color: #ffffff; }

/* ==========================================
   BUTTONS & SUBMIT BARS
   ========================================== */
.btn-dash-primary {
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid #1a1a1a;
    border-radius: 0;
    padding: 14px 24px;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-dash-primary:hover { background: #1a1a1a; color: #ffffff; }

/* The Action Bar */
.submit-bar {
    position: sticky;
    bottom: 0; /* Snap to bottom */
    background: #ffffff; 
    border-top: 1px solid #1a1a1a;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 99;
}

.submit-info strong { display: block; font-family: var(--font-serif); font-size: 20px; color: #1a1a1a; font-weight: 400; margin-bottom: 4px;}
.submit-info span { font-family: var(--font-sans); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: #888888; }

.btn-dash-submit {
    background: #1a1a1a;
    color: #ffffff;
    border: 1px solid #1a1a1a;
    border-radius: 0;
    padding: 16px 36px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-dash-submit:hover { background: transparent; color: #1a1a1a; }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
    .dash-metrics-grid { grid-template-columns: 1fr; gap: 15px; }
}

@media (max-width: 900px) {
    .dash-wrapper { flex-direction: column; }
    .dash-sidebar { width: 100%; padding: 20px; border-right: none; border-bottom: 1px solid #eaeaea; z-index: auto; }
    .dash-nav { flex-direction: row; overflow-x: auto; padding-bottom: 10px; }
    .dash-nav-item { padding: 10px 16px; white-space: nowrap; flex-shrink: 0; }
    .sidebar-brand-area { display: none; }
    .logout-link { margin-top: 0; margin-left: auto; }
    
    .dash-content { padding: 30px 20px; }
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; gap: 30px; }
    
    .form-section { padding: 25px; }
    .submit-bar { flex-direction: column; gap: 20px; text-align: center; padding: 20px;}
    .btn-dash-submit { width: 100%; }
}