/* Basic layout and colors for dashboard and forms. */

body {
    font-family: Arial, sans-serif;
    background: #f4f5f7;
    margin: 0;
}

.container {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 15px;
}

.navbar {
    background: #222;
    color: #fff;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
}

.navbar a {
    color: #fff;
    margin-left: 10px;
    text-decoration: none;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.kpi-card {
    background: #fff;
    border-radius: 4px;
    padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.kpi-row {
    display: flex;
    justify-content: space-between;
    margin: 2px 0;
}

.badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #fff;
}

.badge-red { background: #d9534f; }
.badge-orange { background: #f0ad4e; }
.badge-yellow { background: #f0c14e; color: #000; }
.badge-green { background: #5cb85c; }

.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.filter-bar input,
.filter-bar select {
    padding: 5px;
}

.btn-primary {
    background: #007bff;
    color: #fff;
    padding: 6px 10px;
    border-radius: 3px;
    text-decoration: none;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.data-table th,
.data-table td {
    padding: 6px 8px;
    border: 1px solid #ddd;
    font-size: 13px;
}

.row-red { background: #f2dede; }
.row-orange { background: #fcf8e3; }
.row-yellow { background: #faf2cc; }
.row-green { background: #dff0d8; }

.form-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 8px 10px;
    background: #fff;
    padding: 15px;
    border-radius: 4px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 15px;
    background: #fff;
    padding: 15px;
    border-radius: 4px;
}

/* Auth page */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.auth-card {
    background: #fff;
    padding: 20px 25px;
    border-radius: 4px;
    width: 320px;
    box-shadow: 0 2px 4px rgba(0,0,0,.2);
}

.auth-card input {
    width: 100%;
    margin-bottom: 10px;
}

.alert-danger {
    background: #f2dede;
    padding: 5px 8px;
    margin-bottom: 10px;
}

/* Header / navbar */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    gap: 8px;
}

.brand-logo {
    height: 32px;
    width: 32px;
    object-fit: contain;
}

.brand-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    letter-spacing: 0.02em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    justify-content: center;
}

.nav-item {
    font-size: 14px;
    color: #4b5563;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.nav-cta {
    background: #2563eb;
    color: #ffffff;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.4);
}

.nav-cta:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    font-size: 13px;
    color: #4b5563;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-role {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.btn-logout {
    font-size: 13px;
    color: #ef4444;
    text-decoration: none;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-logout:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

/* Remove old .navbar styles if present */
.navbar { display: none; }
.searchable-select {
    position: relative;
    margin-bottom: 10px;
}

.searchable-select input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.select-option {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.select-option:hover,
.select-option.selected {
    background: #f3f4f6;
}
/* Searchable select UI */

.hidden-select {
    display: none;
}

.searchable-wrapper {
    position: relative;
}

.searchable-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
}

.searchable-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d1d5db;
    border-top: none;
    max-height: 220px;
    overflow-y: auto;
    z-index: 20;
    display: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.searchable-item {
    padding: 6px 8px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

.searchable-item:hover {
    background: #f3f4f6;
}

.add-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.add-hint button {
    border: none;
    background: none;
    padding: 0;
    margin-left: 4px;
    color: #2563eb;
    cursor: pointer;
    font-size: 12px;
}
.service-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;   /* ~66% / 33% */
    gap: 24px;
    align-items: flex-start;
}

.service-main {
    /* contains the form; your existing .form-grid still applies inside */
}

.service-sidebar {
    background: #ffffff;
    border-radius: 6px;
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    font-size: 13px;
    color: #374151;
}

.service-sidebar h2 {
    font-size: 14px;
    margin-top: 0;
    margin-bottom: 8px;
}

/* message blocks */
.add-hint {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.add-hint button {
    border: none;
    background: none;
    padding: 0;
    margin-left: 4px;
    color: #2563eb;
    cursor: pointer;
    font-size: 13px;
}
/* Global look & feel */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f3f4f6;
    color: #111827;
}

/* Page container & headings */
.container {
    max-width: 1180px;
    margin: 28px auto;
    padding: 0 20px 40px;
}

h1 {
    font-size: 26px;
    font-weight: 650;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

h2, h3 {
    letter-spacing: -0.01em;
}
/* Card-style panels */
.kpi-card,
.data-table,
.form-grid,
.detail-grid,
.service-sidebar {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(15,23,42,0.08);
    border: 1px solid rgba(148,163,184,0.25);
    transition: transform 160ms ease-out, box-shadow 160ms ease-out, border-color 160ms ease-out;
}

/* Light hover lift on cards & tables */
.kpi-card:hover,
.data-table:hover,
.detail-grid:hover,
.service-sidebar:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15,23,42,0.14);
    border-color: rgba(59,130,246,0.35);
}
/* Form labels & fields */
.form-grid label {
    font-size: 13px;
    color: #6b7280;
    align-self: center;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    font-size: 14px;
    padding: 7px 9px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease, transform 80ms ease-out;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37,99,235,0.25);
    background: #ffffff;
    transform: translateY(-1px);
}

/* Primary buttons */
button,
.btn-primary {
    border-radius: 999px;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(37,99,235,0.35);
    transition: transform 120ms ease-out, box-shadow 120ms ease-out, filter 120ms ease-out;
}

button:hover,
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(37,99,235,0.40);
    filter: brightness(1.03);
}

button:active,
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(15,23,42,0.35);
}

/* Destructive buttons */
.btn-danger {
    background: #ef4444;
    box-shadow: 0 8px 18px rgba(239,68,68,0.35);
}
.btn-danger:hover {
    filter: brightness(1.05);
}
/* Two-column layout 66/33 */
.service-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 24px;
    align-items: flex-start;
}

/* Sidebar slide-in feel */
.service-sidebar {
    opacity: 0;
    transform: translateX(10px);
    animation: sidebar-in 220ms ease-out forwards;
}

@keyframes sidebar-in {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Searchable select fields */
.searchable-wrapper {
    position: relative;
}

.searchable-input {
    width: 100%;
    padding: 7px 9px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    font-size: 14px;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.searchable-input:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(37,99,235,0.22);
}

.searchable-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 2px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid rgba(148,163,184,0.5);
    max-height: 220px;
    overflow-y: auto;
    z-index: 40;
    box-shadow: 0 16px 40px rgba(15,23,42,0.18);
    display: none;
}

.searchable-item {
    padding: 8px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background 120ms ease, padding-left 120ms ease;
}

.searchable-item:hover {
    background: #eff6ff;
    padding-left: 14px;
}

/* Sidebar “Add it?” messages */
.add-hint {
    font-size: 13px;
    color: #6b7280;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px dashed #cbd5f5;
    background: #eef2ff;
    margin-bottom: 10px;
    animation: fade-in 160ms ease-out;
}

.add-hint button {
    border: none;
    background: none;
    padding: 0 0 0 4px;
    color: #2563eb;
    cursor: pointer;
    font-size: 13px;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(2px); }
    to   { opacity: 1; transform: translateY(0); }
}
.data-table {
    border-radius: 10px;
    overflow: hidden;
}

.data-table thead {
    background: #f9fafb;
}

.data-table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}

.data-table tbody tr {
    transition: background 120ms ease;
}

.data-table tbody tr:hover {
    background: #f3f4ff;
}

