* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: #f4f7fb;
    color: #1f2937;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #000000;
    color: white;
    padding: 24px 16px;
}

.brand h2 {
    margin: 0;
    font-size: 24px;
}

.brand p {
    margin-top: 4px;
    color: #94a3b8;
}

.nav {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav a {
    color: #e2e8f0;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
}

.nav a:hover {
    background: #111111;
}

.content {
    flex: 1;
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.user-box {
    background: white;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #dbe2ea;
}

.card {
    background: white;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.stat {
    background: white;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    padding: 20px;
}

.stat h3 {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: #64748b;
}

.stat p {
    margin: 0;
    font-size: 28px;
    font-weight: bold;
}

.table-wrap {
    background: white;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    padding: 16px;
    overflow-x: auto;
}

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

th, td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background: #f8fafc;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}



.form-card {
    background: white;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    padding: 20px;
    max-width: 800px;
}

form p {
    margin-bottom: 16px;
}

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-top: 6px;
}

textarea {
    min-height: 120px;
}

.actions {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.list-clean {
    margin: 0;
    padding-left: 18px;
}

.card h3,
.table-wrap h3 {
    margin-top: 0;
}

p strong {
    display: inline-block;
    min-width: 220px;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

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

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

.brand-text h2 {
    margin: 0;
    font-size: 20px;
}

.brand-text p {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
}

h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

p {
    line-height: 1.5;
}

th {
    font-weight: 600;
    font-size: 14px;
    color: #475569;
}

td {
    font-size: 14px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav svg {
    width: 18px;
    height: 18px;
}

.nav a.active {
    background: #2563eb;
    color: white;
    font-weight: 600;
    border-radius: 8px;
}



/* BUTTONS */

.btn {
    display: inline-block;
    background: #2563eb; /* default blue */
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn:hover {
    text-decoration: none;
}

.btn-small {
    padding: 6px 10px;
    font-size: 13px;
}

.btn-blue {
    background: #2563eb;
    color: white;
}

.btn-blue:hover {
    background: #1d4ed8;
}

.btn-green {
    background: #16a34a;
    color: white;
}

.btn-green:hover {
    background: #15803d;
}

.btn-red {
    background: #dc2626;
    color: white;
}

.btn-red:hover {
    background: #b91c1c;
}

.btn-secondary {
    background: #475569;
    color: white;
}

.btn-secondary:hover {
    background: #334155;
}

.messages {
    margin-bottom: 20px;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 500;
}

.message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Compact Form Layout - 3 Column */

.compact-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* 🔥 now 3 columns */
    gap: 12px 16px; /* tighter spacing */
}

.form-group {
    display: flex;
    flex-direction: column;
}

/* Full width elements (section headers, notes) */
.form-group.full-width {
    grid-column: span 3;
}

.form-section {
    grid-column: span 3;
    margin-top: 8px;
}

.form-section h3 {
    margin: 8px 0 4px 0;
    font-size: 0.9rem;
    color: #9ca3af;
    font-weight: 600;
}

/* Labels */
.form-group label {
    margin-bottom: 3px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Inputs */
.form-group input,
.form-group select,
.form-group textarea {
    padding: 6px 8px;          /* 🔥 smaller */
    min-height: 34px;          /* 🔥 smaller */
    border-radius: 6px;        /* slightly tighter */
    font-size: 0.9rem;
}

/* Textarea slightly bigger */
.form-group textarea {
    min-height: 70px;
}

/* Mobile fallback */
@media (max-width: 900px) {
    .compact-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-group.full-width,
    .form-section {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .compact-form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width,
    .form-section {
        grid-column: span 1;
    }
}

.form-actions {
    margin-top: 28px;   /* 🔥 creates space from Notes */
    padding-top: 10px;
    display: flex;
    gap: 10px;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
}

/* Asset detail layout */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 24px;
    margin-top: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.detail-item-full {
    grid-column: span 3;
}

.detail-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #5b6472;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 1rem;
    color: #1f2a37;
    word-break: break-word;
}

@media (max-width: 1000px) {
    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-item-full {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-item-full {
        grid-column: span 1;
    }
}

/* Asset filters */

.filter-card {
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
}

@media (max-width: 1100px) {
    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

.bulk-actions-bar {
    margin-bottom: 16px;
    padding: 14px 16px;
}

.bulk-actions-left {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.bulk-actions-left select {
    min-width: 180px;
}

.table-wrap input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Top-right user dropdown */

.user-menu {
    position: relative;
    display: inline-block;
}

.user-menu-button {
    background: white;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    color: #1f2937;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-menu-button:hover {
    background: #f8fafc;
}

.user-menu-arrow {
    font-size: 12px;
    color: #64748b;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: white;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    padding: 8px;
    display: none;
    z-index: 1000;
}

.user-menu.open .user-dropdown {
    display: block;
}

.user-dropdown-link {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: #1f2937;
    text-decoration: none;
    font-size: 14px;
}

.user-dropdown-link:hover {
    background: #f8fafc;
    text-decoration: none;
}

.logout-button {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
    padding: 10px 12px;
    border-radius: 8px;
    color: #1f2937;
}

/* remove weird focus/active highlight */
.logout-button:focus,
.logout-button:active {
    outline: none;
    box-shadow: none;
    background: none;
}

/* match hover style with links */
.logout-button:hover {
    background: #f8fafc;
}

/* Login header (logo + text centered) */

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header img {
    max-height: 70px;
    width: auto;
    margin-bottom: 16px;
}

.login-subtitle {
    color: #9ca3af;
    font-size: 14px;
    margin-bottom: 4px;
}

.login-title {
    color: #ec4899; /* your pink */
    font-size: 22px;
    font-weight: 600;
    margin: 0;
}


/* App login page */

.app-login-body {
    margin: 0;
    min-height: 100vh;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.app-login-wrapper {
    width: 100%;
    max-width: 460px;
    padding: 24px;
}

.app-login-card {
    background: transparent;
}

.app-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.app-login-logo {
    display: block;
    margin: 0 auto 16px auto;
    width: 90px;
    height: 90px;
    object-fit: contain;
}

.app-login-subtitle {
    margin: 0 0 6px 0;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.app-login-title {
    margin: 0;
    color: #ec4899;
    font-size: 22px;
    font-weight: 700;
}

.app-login-error {
    margin-bottom: 18px;
    color: #f87171;
    text-align: center;
    font-size: 14px;
}

.app-login-form .form-group {
    margin-bottom: 20px;
}

.app-login-form label {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
}

.app-login-form input {
    width: 100%;
    box-sizing: border-box;
    background: #000000;
    color: #ffffff;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 15px;
}

.app-login-form input:focus {
    outline: none;
    border-color: #ec4899;
}

.app-login-button {
    width: 100%;
    margin-top: 10px;
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);

}

.app-login-button:hover {
    background: #e5e7eb;
}


/* DASHBOARD CHARTS */

.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.chart-wrap {
    position: relative;
    height: 300px;
}

.warning-stat p {
    color: #ef4444;
}

@media (max-width: 900px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}