/* TOP NAVBAR */
.topbar {
    height: 38px;
    padding: 0 16px;
    background: #0f172a;
    border-bottom: 1px solid #1f2937;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar * {
    line-height: 1;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ========================= */
/* LOGO + TITLE */
/* ========================= */

.logo-icon {
    width: 22px;
    height: 22px;
    background-image: url('../../fcmfavicon.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 4px;
}

.site-title {
    font-size: 16px;
    font-weight: 600;
    color: #e5e7eb;
}

.site-title a {
    color: #fff;
    text-decoration: none;
}

.site-title a:hover,
.site-title a:focus,
.site-title a:active {
    color: #fff;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.add-btn {
    background: #1f2937;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 2px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.2s;
    line-height: 1;
}

.add-btn:hover {
    background: #273549;
}

.user-name {
    font-size: 14px;
    color: #9ca3af;
    cursor: pointer;
}
/* RESET */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Roboto, sans-serif;
}

html,
body {
    height: 100%;
}

body {
    background: linear-gradient(180deg, #111827, #0f172a);
    color: #e5e7eb;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-wrapper {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 25px 25px 25px;
}
.top-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 25px;
}

.stat-box {
    background: #1f2937;
    padding: 20px;
    border-radius: 8px;
    min-width: 160px;
}

.stat-box .value {
    font-size: 22px;
    font-weight: 600;
}

.stat-box .label {
    font-size: 12px;
    text-transform: uppercase;
    color: #9ca3af;
    margin-top: 5px;
}
.container {
    padding: 25px;
    margin-top: 20px;
    /* ← ini jaraknya */
}
/* FARM GRID */
.farm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

/* FARM CARD */
.farm-card {
    background: #1f2937;
    padding: 20px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: 0.2s ease;
}

.farm-card:hover {
    background: #273549;
}

.farm-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

/* FARM STATS ROW */
.farm-stats {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 10px;
}

.farm-stats strong {
    color: #e5e7eb;
    font-size: 15px;
}
.farm-card.add-card {
    cursor: pointer;
}

#farm-form-container {
    display: none; /* default hidden */
    grid-column: 1 / -1; /* biar ambil full width grid */
    margin: 0 auto;      /* center horizontal */
    max-width: 600px;    /* biar ga terlalu lebar */
}

/* BALANCE */
.balance {
    margin-top: 10px;
    font-size: 14px;
}

.balance strong {
    color: #22c55e;
}

.form-card {
    background: #1f2937;
    padding: 25px;
    border-radius: 10px;
    max-width: 500px;
}

.form-card h2 {
    margin-bottom: 20px;
}

.form-card input {
    width: 100%;
    padding: 10px;
    border: 1px solid #374151;
    border-radius: 6px;
    background: #111827;
    color: #e5e7eb;
    margin-bottom: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
}

#cancelForm {
    background: transparent;
    border: 1px solid #374151;
    color: #9ca3af;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

#cancelForm:hover {
    background: #273549;
}


/* FOOTER */
.footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #1f2937;
    background: transparent;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 25px;

    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;

    font-size: 12px;
    color: #6b7280;
}

.footer a {
    color: #9ca3af;
    text-decoration: none;
    transition: 0.2s;
}

.footer a:hover {
    color: #22c55e;
}
.user-menu {
    position: relative;
}

.user-name {
    font-size: 14px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.user-name:hover {
    background: #273549;
}

.user-menu .dropdown {
    display:none;
    position:absolute;

    left:0;
    top:calc(100% + 4px);

    background:#1f2937;
    border:1px solid #374151;
    border-radius:6px;

    min-width:80px;
    width:max-content;

    z-index:10;
}

.user-menu .dropdown a {
    display: block;
    padding: 8px 12px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 13px;
}

.user-menu .dropdown a:hover {
    background: #273549;
}

.user-menu .dropdown{
opacity:0;
transform:translateY(-5px);
transition:0.15s;
}

.user-menu .dropdown.active{
display:block;
opacity:1;
transform:translateY(0);
}

.user-menu:hover .dropdown{
display:block;
opacity:1;
transform:translateY(0);
}

@media (hover:hover){
.user-menu:hover .dropdown{
display:block;
}
}

.farm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.farm-actions {
    display: flex;
    gap: 6px;
}

.farm-actions svg {
    cursor: pointer;
    color: #9ca3af;
    transition: 0.2s;
}

.farm-actions svg:hover {
    transform: scale(1.1);
}

.edit-icon svg:hover {
    color: #f59e0b; /* orange untuk edit */
}

.delete-icon svg:hover {
    color: #f87171; /* merah untuk delete */
}
.farm-card a {
    color: #e5e7eb;       /* putih */
    text-decoration: none; /* hilangkan underline */
}

.farm-card a:hover {
    color: #f59e0b;        /* opsional: orange saat hover */
}
.modal {
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.modal-card {
    background: #1f2937;
    padding: 20px;
    border-radius: 10px;
    width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.modal-card h2 {
    color: #e5e7eb;
    margin-bottom: 15px;
}
.modal-card input, .modal-card select {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid #374151;
    border-radius: 6px;
    background: #111827;
    color: #e5e7eb;
}
.modal-card button {
    padding: 10px;
    border: 1px solid #374151;
    border-radius: 6px;
    background: #1f2937;
    color: #e5e7eb;
    cursor: pointer;
}
.modal-card button:hover {
    background: #273549;
}

.farm-actions span {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.farm-actions span::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%; /* muncul di atas icon */
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: #e5e7eb;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.farm-actions span:hover::after {
    opacity: 1;
}