:root {
    --ecsa-blue: #004a99;
    --ecsa-dark: #003366;
    --ecsa-light: #e6f0fa;
    --text-dark: #333333;
    --text-muted: #666666;
    --white: #ffffff;
    --bg-gray: #f8f9fa;
    --primary-color: #3860b2;
    --secondary-color: #00126b;
    --bg-light: #f1f4f9;
    --accent: #bacae2;
    --success-color: #28a745;
    --error-color: #dc3545;
}

body {
    font-family: 'Open Sans', Arial, sans-serif;
    background-color: var(--white);
    margin: 0;
    padding: 0;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Common Layout */
.top-bar {
    background-color: var(--ecsa-dark);
    height: 5px;
    width: 100%;
}

header {
    background-color: var(--white);
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
}

/* Dashboard Specific Header */
header.dashboard-header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1680px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 77px;
    width: auto;
    display: block;
}

/* Containers */
.container {
    max-width: 1680px;
    margin: 20px auto;
    padding: 20px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.main-container {
    max-width: 1680px;
    margin: 0 auto;
    padding: 0 15px 40px 15px;
}

/* Breadcrumbs */
.breadcrumb-bg {
    background-color: var(--bg-gray);
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.breadcrumb-container {
    max-width: 1370px;
    margin: 0 auto;
    padding: 0 15px;
    font-size: 14px;
    color: #4a5568;
}

.breadcrumb-container a {
    color: var(--ecsa-blue);
    text-decoration: none;
}

.breadcrumb-container span {
    margin: 0 8px;
}

/* Hero Section */
.hero {
    background-color: var(--ecsa-blue);
    color: var(--white);
    padding: 25px 0;
    margin-bottom: 25px;
}

.hero-container {
    max-width: 1370px;
    margin: 0 auto;
    padding: 0 15px;
}

.hero h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

/* Controls & Forms */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-end;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
}

.form-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-size: 14px;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

input, select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s;
    font-size: 14px;
}

.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--secondary-color); }
.btn-add { background-color: var(--success-color); color: white; }
.btn-add:hover { background-color: #218838; }
.btn-submit { background-color: var(--primary-color); color: white; font-size: 16px; }
.btn-submit:hover { background-color: var(--secondary-color); }
.btn-danger { background-color: var(--error-color); color: white; }
.btn-danger:hover { background-color: #c82333; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: var(--accent);
    color: var(--secondary-color);
    font-size: 14px;
}

.table-bordered th, .table-bordered td {
    border: 1px solid #dee2e6;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f9f9f9;
}

/* Results Display specific */
.results-header-box { margin-bottom: 30px; }
.election-body-tag {
    display: inline-block;
    background-color: var(--ecsa-blue);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
}
h1.main-title { color: var(--ecsa-dark); font-size: 2.2rem; margin: 0; font-weight: 700; }
.outcome-box {
    background-color: var(--bg-gray);
    padding: 20px;
    border-radius: 4px;
    border-left: 4px solid #28a745;
    font-size: 1.1rem;
}
progress { height: 12px; border-radius: 6px; flex-grow: 1; }
.status-elected { color: #28a745; font-weight: 700; }

/* Caching / Listing specific */
.election-group { margin-bottom: 20px; }
.group-header {
    font-size: 15px;
    font-weight: 700;
    color: var(--white);
    background: linear-gradient(to right, var(--ecsa-blue), transparent);
    padding: 6px 12px;
    margin-bottom: 10px;
    border-radius: 4px 0 0 4px;
}
.election-card {
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-left: 4px solid var(--ecsa-blue);
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 6px;
}
.election-card h2 {
    font-size: 15px;
    margin: 0;
}

.view-btn {
    background-color: var(--ecsa-blue);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.2s ease;
    border: 2px solid var(--ecsa-blue);
    white-space: nowrap;
}

.view-btn:hover {
    background-color: var(--white);
    color: var(--ecsa-blue);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.election-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 10px;
}

.compact-row {
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-left: 4px solid var(--ecsa-blue);
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    border-radius: 4px;
    transition: background-color 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.compact-row:hover {
    background-color: var(--ecsa-light) !important;
    border-color: var(--ecsa-blue);
}

.compact-row.periodic {
    border-left: 5px solid #28a745;
    background-color: #f0fff4;
}

.type-badge-inline {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.row-content-text {
    flex: 1;
    font-size: 13px;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.view-link-inline {
    font-size: 11px;
    font-weight: 700;
    color: var(--ecsa-blue);
    text-decoration: none;
    margin-left: 5px;
}

.view-link-inline:hover {
    text-decoration: underline;
}

.v-card {
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-left: 4px solid var(--ecsa-blue);
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.v-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.v-card.periodic {
    border-left: 5px solid #28a745;
    background: #f0fff4;
}

/* Entry Specifics */
.publish-box {
    background-color: #e8f0fe;
    border: 2px solid var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}
.summary-header {
    background-color: var(--bg-accent);
    padding: 10px 15px;
    margin: 20px 0 10px 0;
    font-weight: bold;
    font-size: 16px;
    color: var(--secondary-color);
}
.validation-box {
    padding: 5px;
    text-align: center;
    font-weight: bold;
    border-radius: 4px;
    color: white;
    display: inline-block;
    min-width: 60px;
}
.valid { background-color: var(--success-color); }
.invalid { background-color: var(--error-color); }
.quota-display {
    background-color: #66b6e3;
    color: white;
    padding: 7px 8px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    display: block;
    text-align: center;
}
.candidate-row.hidden { display: none; }

footer {
    background-color: var(--ecsa-dark);
    color: var(--white);
    padding: 40px 0;
    text-align: center;
    font-size: 14px;
}

@media print {
    .top-bar, header, footer, .back-nav, .header-actions, .controls, .breadcrumb-bg { display: none; }
    body { background: white; }
    .container { margin: 0; max-width: 100%; box-shadow: none; }
}
